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) {