@@ -856,7 +856,7 @@ |
||
| 856 | 856 | return $this; |
| 857 | 857 | } |
| 858 | 858 | |
| 859 | - /** |
|
| 859 | + /** |
|
| 860 | 860 | * Check if the current sql language is based on oracle syntax. |
| 861 | 861 | * |
| 862 | 862 | * @return bool |
@@ -270,22 +270,22 @@ |
||
| 270 | 270 | $column = $this->castColumn($column); |
| 271 | 271 | if ($this->isCaseInsensitive()) { |
| 272 | 272 | if ($this->request->isRegex($i)) { |
| 273 | - if($this->isOracleSql()){ |
|
| 274 | - $this->query->whereRaw(' REGEXP_LIKE( LOWER('.$column.') , ?, \'i\' )', [$keyword]); |
|
| 275 | - }else{ |
|
| 276 | - $this->query->whereRaw('LOWER(' . $column . ') REGEXP ?', [Str::lower($keyword)]); |
|
| 277 | - } |
|
| 273 | + if($this->isOracleSql()){ |
|
| 274 | + $this->query->whereRaw(' REGEXP_LIKE( LOWER('.$column.') , ?, \'i\' )', [$keyword]); |
|
| 275 | + }else{ |
|
| 276 | + $this->query->whereRaw('LOWER(' . $column . ') REGEXP ?', [Str::lower($keyword)]); |
|
| 277 | + } |
|
| 278 | 278 | } else { |
| 279 | 279 | $this->query->whereRaw('LOWER(' . $column . ') LIKE ?', [Str::lower($keyword)]); |
| 280 | 280 | } |
| 281 | 281 | } else { |
| 282 | 282 | $col = strstr($column, '(') ? $this->connection->raw($column) : $column; |
| 283 | 283 | if ($this->request->isRegex($i)) { |
| 284 | - if($this->isOracleSql()){ |
|
| 285 | - $this->query->whereRaw(' REGEXP_LIKE( '.$col.' , ? )', [$keyword]); |
|
| 286 | - }else{ |
|
| 287 | - $this->query->whereRaw($col . ' REGEXP ?', [$keyword]); |
|
| 288 | - } |
|
| 284 | + if($this->isOracleSql()){ |
|
| 285 | + $this->query->whereRaw(' REGEXP_LIKE( '.$col.' , ? )', [$keyword]); |
|
| 286 | + }else{ |
|
| 287 | + $this->query->whereRaw($col . ' REGEXP ?', [$keyword]); |
|
| 288 | + } |
|
| 289 | 289 | } else { |
| 290 | 290 | $this->query->whereRaw($col . ' LIKE ?', [$keyword]); |
| 291 | 291 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $myQuery = clone $this->query; |
| 86 | 86 | // if its a normal query ( no union, having and distinct word ) |
| 87 | 87 | // replace the select with static text to improve performance |
| 88 | - if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
| 88 | + if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
| 89 | 89 | $row_count = $this->connection->getQueryGrammar()->wrap('row_count'); |
| 90 | 90 | $myQuery->select($this->connection->raw("'1' as {$row_count}")); |
| 91 | 91 | } |
@@ -270,9 +270,9 @@ discard block |
||
| 270 | 270 | $column = $this->castColumn($column); |
| 271 | 271 | if ($this->isCaseInsensitive()) { |
| 272 | 272 | if ($this->request->isRegex($i)) { |
| 273 | - if($this->isOracleSql()){ |
|
| 274 | - $this->query->whereRaw(' REGEXP_LIKE( LOWER('.$column.') , ?, \'i\' )', [$keyword]); |
|
| 275 | - }else{ |
|
| 273 | + if ($this->isOracleSql()) { |
|
| 274 | + $this->query->whereRaw(' REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )', [$keyword]); |
|
| 275 | + } else { |
|
| 276 | 276 | $this->query->whereRaw('LOWER(' . $column . ') REGEXP ?', [Str::lower($keyword)]); |
| 277 | 277 | } |
| 278 | 278 | } else { |
@@ -281,9 +281,9 @@ discard block |
||
| 281 | 281 | } else { |
| 282 | 282 | $col = strstr($column, '(') ? $this->connection->raw($column) : $column; |
| 283 | 283 | if ($this->request->isRegex($i)) { |
| 284 | - if($this->isOracleSql()){ |
|
| 285 | - $this->query->whereRaw(' REGEXP_LIKE( '.$col.' , ? )', [$keyword]); |
|
| 286 | - }else{ |
|
| 284 | + if ($this->isOracleSql()) { |
|
| 285 | + $this->query->whereRaw(' REGEXP_LIKE( ' . $col . ' , ? )', [$keyword]); |
|
| 286 | + } else { |
|
| 287 | 287 | $this->query->whereRaw($col . ' REGEXP ?', [$keyword]); |
| 288 | 288 | } |
| 289 | 289 | } else { |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | if ($this->request->isRegex($i)) { |
| 273 | 273 | if($this->isOracleSql()){ |
| 274 | 274 | $this->query->whereRaw(' REGEXP_LIKE( LOWER('.$column.') , ?, \'i\' )', [$keyword]); |
| 275 | - }else{ |
|
| 275 | + } else{ |
|
| 276 | 276 | $this->query->whereRaw('LOWER(' . $column . ') REGEXP ?', [Str::lower($keyword)]); |
| 277 | 277 | } |
| 278 | 278 | } else { |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | if ($this->request->isRegex($i)) { |
| 284 | 284 | if($this->isOracleSql()){ |
| 285 | 285 | $this->query->whereRaw(' REGEXP_LIKE( '.$col.' , ? )', [$keyword]); |
| 286 | - }else{ |
|
| 286 | + } else{ |
|
| 287 | 287 | $this->query->whereRaw($col . ' REGEXP ?', [$keyword]); |
| 288 | 288 | } |
| 289 | 289 | } else { |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - 'oracle_sql' => false, |
|
| 5 | + 'oracle_sql' => false, |
|
| 6 | 6 | |
| 7 | 7 | 'search' => [ |
| 8 | 8 | 'case_insensitive' => true, |