| @@ 183-200 (lines=18) @@ | ||
| 180 | $callback($builder, $keyword); |
|
| 181 | $query->addNestedWhereQuery($builder, 'or'); |
|
| 182 | } else { |
|
| 183 | if (count(explode('.', $columnName)) > 1) { |
|
| 184 | $eagerLoads = $this->getEagerLoads(); |
|
| 185 | $parts = explode('.', $columnName); |
|
| 186 | $relationColumn = array_pop($parts); |
|
| 187 | $relation = implode('.', $parts); |
|
| 188 | if (in_array($relation, $eagerLoads)) { |
|
| 189 | $this->compileRelationSearch( |
|
| 190 | $query, |
|
| 191 | $relation, |
|
| 192 | $relationColumn, |
|
| 193 | $keyword |
|
| 194 | ); |
|
| 195 | } else { |
|
| 196 | $this->compileQuerySearch($query, $columnName, $keyword); |
|
| 197 | } |
|
| 198 | } else { |
|
| 199 | $this->compileQuerySearch($query, $columnName, $keyword); |
|
| 200 | } |
|
| 201 | } |
|
| 202 | ||
| 203 | $this->isFilterApplied = true; |
|
| @@ 463-476 (lines=14) @@ | ||
| 460 | $builder = $this->query->newQuery(); |
|
| 461 | $callback($builder, $keyword); |
|
| 462 | $this->query->addNestedWhereQuery($builder); |
|
| 463 | } else { |
|
| 464 | if (count(explode('.', $column)) > 1) { |
|
| 465 | $eagerLoads = $this->getEagerLoads(); |
|
| 466 | $parts = explode('.', $column); |
|
| 467 | $relationColumn = array_pop($parts); |
|
| 468 | $relation = implode('.', $parts); |
|
| 469 | if (in_array($relation, $eagerLoads)) { |
|
| 470 | $column = $this->joinEagerLoadedColumn($relation, $relationColumn); |
|
| 471 | } |
|
| 472 | } |
|
| 473 | ||
| 474 | $keyword = $this->getColumnSearchKeyword($index); |
|
| 475 | $this->compileColumnSearch($index, $column, $keyword); |
|
| 476 | } |
|
| 477 | ||
| 478 | $this->isFilterApplied = true; |
|
| 479 | } |
|