|
@@ 68-74 (lines=7) @@
|
| 65 |
|
*/ |
| 66 |
|
$model->where(function ($q) use ($query, $conditionColumns, $relations){ |
| 67 |
|
|
| 68 |
|
if (count($conditionColumns)) |
| 69 |
|
{ |
| 70 |
|
/** |
| 71 |
|
* Use the first element in the model columns to construct the first condition. |
| 72 |
|
*/ |
| 73 |
|
$q->where(\DB::raw('LOWER(' . array_shift($conditionColumns) . ')'), 'LIKE', '%' . strtolower($query) . '%'); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
/** |
| 77 |
|
* Loop through the rest of the columns to construct or where conditions. |
|
@@ 111-117 (lines=7) @@
|
| 108 |
|
*/ |
| 109 |
|
$subConditionColumns = \Core::$relation()->model->searchable; |
| 110 |
|
|
| 111 |
|
if (count($subConditionColumns)) |
| 112 |
|
{ |
| 113 |
|
/** |
| 114 |
|
* Use the first element in the relation model columns to construct the first condition. |
| 115 |
|
*/ |
| 116 |
|
$q->where(\DB::raw('LOWER(' . array_shift($subConditionColumns) . ')'), 'LIKE', '%' . strtolower($query) . '%'); |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
/** |
| 120 |
|
* Loop through the rest of the columns to construct or where conditions. |