Browse Source

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

master
wanghongjun 1 month ago
parent
commit
f4ea25fff8
  1. 12
      app/Http/Controllers/Admin/ParkingAlarmInformationController.php

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

@ -42,20 +42,20 @@ class ParkingAlarmInformationController extends BaseController
if ($request->has('keyword')) { if ($request->has('keyword')) {
$keyword = $request->input('keyword'); $keyword = $request->input('keyword');
if ($keyword) { if ($keyword) {
$type_id = 0; $type_id = [];
$nameTypeId = AdminTranslationService::getTypeId(100, $keyword); $nameTypeId = AdminTranslationService::getLikeTypeIds(100, $keyword);
if ($nameTypeId) { if ($nameTypeId) {
$type_id = $nameTypeId; $type_id = $nameTypeId;
} }
$conditionTypeId = AdminTranslationService::getTypeId(101, $keyword); $conditionTypeId = AdminTranslationService::getLikeTypeIds(101, $keyword);
if ($conditionTypeId) { if ($conditionTypeId) {
$type_id = $conditionTypeId; $type_id = $conditionTypeId;
} }
$contentTypeId = AdminTranslationService::getTypeId(102, $keyword); $contentTypeId = AdminTranslationService::getLikeTypeIds(102, $keyword);
if ($contentTypeId) { if ($contentTypeId) {
$type_id = $contentTypeId; $type_id = $contentTypeId;
} }
$remarkTypeId = AdminTranslationService::getTypeId(103, $keyword); $remarkTypeId = AdminTranslationService::getLikeTypeIds(103, $keyword);
if ($remarkTypeId) { if ($remarkTypeId) {
$type_id = $remarkTypeId; $type_id = $remarkTypeId;
} }
@ -64,7 +64,7 @@ class ParkingAlarmInformationController extends BaseController
$q->orWhere('condition', $keyword); $q->orWhere('condition', $keyword);
$q->orWhere('content', $keyword); $q->orWhere('content', $keyword);
$q->orWhere('remark', $keyword); $q->orWhere('remark', $keyword);
$q->orWhere('id', $type_id); $q->orWhereIn('id', $type_id);
}); });
} }
} }

Loading…
Cancel
Save