From 8a777027c2a78ed4a42a3a0839ade40c3f384290 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Fri, 26 Jun 2026 18:22:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=A1=E6=81=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=97=E8=A1=A8=E6=A8=A1=E7=B3=8A=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=972?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParkingAlarmInformationController.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Admin/ParkingAlarmInformationController.php b/app/Http/Controllers/Admin/ParkingAlarmInformationController.php index 8a52f10..08243eb 100644 --- a/app/Http/Controllers/Admin/ParkingAlarmInformationController.php +++ b/app/Http/Controllers/Admin/ParkingAlarmInformationController.php @@ -45,26 +45,34 @@ class ParkingAlarmInformationController extends BaseController $type_id = []; $nameTypeId = AdminTranslationService::getLikeTypeIds(100, $keyword); if ($nameTypeId) { - $type_id = $nameTypeId; + $type_id = $nameTypeId; } $conditionTypeId = AdminTranslationService::getLikeTypeIds(101, $keyword); if ($conditionTypeId) { - $type_id = $conditionTypeId; + $type_id = array_merge($type_id, + (array)$conditionTypeId + ); } $contentTypeId = AdminTranslationService::getLikeTypeIds(102, $keyword); if ($contentTypeId) { - $type_id = $contentTypeId; + $type_id = array_merge($type_id, + (array)$contentTypeId + ); } $remarkTypeId = AdminTranslationService::getLikeTypeIds(103, $keyword); if ($remarkTypeId) { - $type_id = $remarkTypeId; + $type_id = array_merge($type_id, + (array)$remarkTypeId + ); } $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->orWhereIn('id', $type_id); + if ($type_id) { + $q->orWhereIn('id', $type_id); + } }); } }