修复bug

This commit is contained in:
Your Name
2026-05-08 10:49:32 +08:00
parent 8c640abb26
commit 43110e015d
6 changed files with 169 additions and 36 deletions
+13 -4
View File
@@ -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;
}