From 35dd4b1140c5221c130308c8640c0925890be165 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 27 May 2024 10:00:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=9C=A8=E5=A4=84?= =?UTF-8?q?=E7=90=86class=5Fkey=E5=92=8Cclass=5Fvalue=E6=97=B6=E6=9C=AA?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=98=AF=E5=90=A6=E4=B8=BAnull=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/lists/ListsSearchTrait.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/common/lists/ListsSearchTrait.php b/app/common/lists/ListsSearchTrait.php index bae153e..2f1d5b2 100644 --- a/app/common/lists/ListsSearchTrait.php +++ b/app/common/lists/ListsSearchTrait.php @@ -23,12 +23,16 @@ trait ListsSearchTrait } $where = []; $class_key=$this->request->__get('class_key'); - foreach($class_key as $key => $value){ - array_push($search[$key], $value); // 添加class_key的搜索条件 + if($class_key!==null){ + foreach($class_key as $key => $value){ + array_push($search[$key], $value); // 添加class_key的搜索条件 + } } + $class_value=$this->request->__get('class_value'); // 获取class_value的值 - if($class_value){ + if($class_value!==null){ $this->params=array_merge($this->params,$class_value); + } foreach ($search as $whereType => $whereFields) { switch ($whereType) {