diff --git a/app/Http/Controllers/Admin/ParkingAlarmInformationController.php b/app/Http/Controllers/Admin/ParkingAlarmInformationController.php index 08243eb..dab88dc 100644 --- a/app/Http/Controllers/Admin/ParkingAlarmInformationController.php +++ b/app/Http/Controllers/Admin/ParkingAlarmInformationController.php @@ -45,31 +45,31 @@ class ParkingAlarmInformationController extends BaseController $type_id = []; $nameTypeId = AdminTranslationService::getLikeTypeIds(100, $keyword); if ($nameTypeId) { - $type_id = $nameTypeId; + $type_id = $nameTypeId->toArray(); } $conditionTypeId = AdminTranslationService::getLikeTypeIds(101, $keyword); if ($conditionTypeId) { $type_id = array_merge($type_id, - (array)$conditionTypeId + $conditionTypeId->toArray() ); } $contentTypeId = AdminTranslationService::getLikeTypeIds(102, $keyword); if ($contentTypeId) { $type_id = array_merge($type_id, - (array)$contentTypeId + $contentTypeId->toArray() ); } $remarkTypeId = AdminTranslationService::getLikeTypeIds(103, $keyword); if ($remarkTypeId) { $type_id = array_merge($type_id, - (array)$remarkTypeId + $remarkTypeId->toArray() ); } $query->where(function ($q) use ($keyword, $type_id) { - $q->orWhere('name', $keyword); - $q->orWhere('condition', $keyword); - $q->orWhere('content', $keyword); - $q->orWhere('remark', $keyword); + $q->orWhere('name', 'like', "%{$keyword}%"); + $q->orWhere('condition', 'like', "%{$keyword}%"); + $q->orWhere('content', 'like', "%{$keyword}%"); + $q->orWhere('remark', 'like', "%{$keyword}%"); if ($type_id) { $q->orWhereIn('id', $type_id); }