Browse Source

告警信息管理列表模糊搜索关键字2

master
wanghongjun 1 month ago
parent
commit
8a777027c2
  1. 14
      app/Http/Controllers/Admin/ParkingAlarmInformationController.php

14
app/Http/Controllers/Admin/ParkingAlarmInformationController.php

@ -49,22 +49,30 @@ class ParkingAlarmInformationController extends BaseController
} }
$conditionTypeId = AdminTranslationService::getLikeTypeIds(101, $keyword); $conditionTypeId = AdminTranslationService::getLikeTypeIds(101, $keyword);
if ($conditionTypeId) { if ($conditionTypeId) {
$type_id = $conditionTypeId; $type_id = array_merge($type_id,
(array)$conditionTypeId
);
} }
$contentTypeId = AdminTranslationService::getLikeTypeIds(102, $keyword); $contentTypeId = AdminTranslationService::getLikeTypeIds(102, $keyword);
if ($contentTypeId) { if ($contentTypeId) {
$type_id = $contentTypeId; $type_id = array_merge($type_id,
(array)$contentTypeId
);
} }
$remarkTypeId = AdminTranslationService::getLikeTypeIds(103, $keyword); $remarkTypeId = AdminTranslationService::getLikeTypeIds(103, $keyword);
if ($remarkTypeId) { if ($remarkTypeId) {
$type_id = $remarkTypeId; $type_id = array_merge($type_id,
(array)$remarkTypeId
);
} }
$query->where(function ($q) use ($keyword, $type_id) { $query->where(function ($q) use ($keyword, $type_id) {
$q->orWhere('name', $keyword); $q->orWhere('name', $keyword);
$q->orWhere('condition', $keyword); $q->orWhere('condition', $keyword);
$q->orWhere('content', $keyword); $q->orWhere('content', $keyword);
$q->orWhere('remark', $keyword); $q->orWhere('remark', $keyword);
if ($type_id) {
$q->orWhereIn('id', $type_id); $q->orWhereIn('id', $type_id);
}
}); });
} }
} }

Loading…
Cancel
Save