From 101c6df5952055b185d82d81760b76cd85ac7ce6 Mon Sep 17 00:00:00 2001 From: zcstatham <578322713@qq.com> Date: Thu, 8 Sep 2022 21:05:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E8=AF=9D=E5=AF=BC=E5=87=BA=E8=B0=83?= =?UTF-8?q?=E8=AF=955?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/service/CarInfoHandle.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extend/service/CarInfoHandle.php b/extend/service/CarInfoHandle.php index d38aca4..d14d3a8 100644 --- a/extend/service/CarInfoHandle.php +++ b/extend/service/CarInfoHandle.php @@ -141,7 +141,7 @@ class CarInfoHandle if (count($map_or2) > 0) { $map_or2 = array_merge([['car_info_t.insurer1_date', '=', ''], ['car_info_t.insurer2_date', '<>', '']], $map_or2); } - $query = CarInfoT::where($where)->where(function ($query) use ($map_or1, $map_or2) { + $query = CarInfoT::where(empty($where) ? 1:$where)->where(function ($query) use ($map_or1, $map_or2) { if (count($map_or1) > 0 && count($map_or2) > 0) { $query->whereOr([$map_or1, $map_or2]); } @@ -156,8 +156,6 @@ class CarInfoHandle ->where('peer_phone_t.source', $data['source_id']) ->where('car_info_t.car_number', 'REGEXP', '^[1-9][[:digit:]]{7}((0[[:digit:]])|(1[0-2]))(([0|1|2][[:digit:]])|3[0-1])[[:digit:]]{3}$|^[1-9][[:digit:]]{5}[1-9][[:digit:]]{3}((0[[:digit:]])|(1[0-2]))(([0|1|2][[:digit:]])|3[0-1])[[:digit:]]{3}([0-9]|X)$') ->field('car_info_t.*')->order('car_info_t.car_phone asc'); - $query->first(); - echo $query->getLastSql();exit(); } }else { $query = $query->order('register_date asc');