修复bug
This commit is contained in:
@@ -47,10 +47,15 @@ trait ListsSearchTrait
|
||||
case 'in':
|
||||
foreach ($whereFields as $whereField) {
|
||||
$paramsName = substr_symbol_behind($whereField);
|
||||
if (!isset($this->params[$paramsName]) || $this->params[$paramsName] == '') {
|
||||
if (!isset($this->params[$paramsName])) {
|
||||
continue;
|
||||
}
|
||||
$where[] = [$whereField, $whereType, $this->params[$paramsName]];
|
||||
$paramVal = $this->params[$paramsName];
|
||||
// 勿用 == '':PHP 中 0 == '' 为 true,会误跳过 prescription_audit_status=0 等合法筛选
|
||||
if ($paramVal === '' || $paramVal === null) {
|
||||
continue;
|
||||
}
|
||||
$where[] = [$whereField, $whereType, $paramVal];
|
||||
}
|
||||
break;
|
||||
case '%like%':
|
||||
@@ -95,10 +100,14 @@ trait ListsSearchTrait
|
||||
case 'find_in_set': // find_in_set查询
|
||||
foreach ($whereFields as $whereField) {
|
||||
$paramsName = substr_symbol_behind($whereField);
|
||||
if (!isset($this->params[$paramsName]) || $this->params[$paramsName] == '') {
|
||||
if (!isset($this->params[$paramsName])) {
|
||||
continue;
|
||||
}
|
||||
$where[] = [$whereField, 'find in set', $this->params[$paramsName]];
|
||||
$paramVal = $this->params[$paramsName];
|
||||
if ($paramVal === '' || $paramVal === null) {
|
||||
continue;
|
||||
}
|
||||
$where[] = [$whereField, 'find in set', $paramVal];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user