fixed:修复搜索参数值为0时导致搜索错误

This commit is contained in:
JaguarJack 2020-11-19 17:30:30 +08:00
parent 78e782dd01
commit ecf0970ca4

View File

@ -118,7 +118,7 @@ class CatchQuery extends Query
foreach ($params as $field => $value) { foreach ($params as $field => $value) {
$method = 'search' . Str::studly($field) . 'Attr'; $method = 'search' . Str::studly($field) . 'Attr';
if ($value && method_exists($this->model, $method)) { if ($value !== null && method_exists($this->model, $method)) {
$this->model->$method($this, $value, $params); $this->model->$method($this, $value, $params);
} }
} }