修改搜索

This commit is contained in:
JaguarJack 2020-05-26 22:39:06 +08:00
parent c60d8d2dc9
commit ea6a4b15a8
2 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,7 @@ namespace catcher;
use catcher\base\CatchModel;
use think\db\Query;
use think\helper\Str;
use think\Paginator;
class CatchQuery extends Query
@ -115,7 +116,14 @@ class CatchQuery extends Query
return $this;
}
return $this->withSearch(array_keys($params), Utils::filterSearchParams($params));
foreach ($params as $field => $value) {
$method = 'search' . Str::studly($field) . 'Attr';
if (method_exists($this->model, $method)) {
$this->model->$method($this, $value ?? null, $params);
}
}
return $this;
}
/**

View File

@ -0,0 +1 @@
<?php