feat:自定义公共搜索初始化操作符号支持 !140

This commit is contained in:
Lysander 2023-10-10 05:05:06 +00:00 committed by 妙码生花
parent d242add400
commit 39df7c2821

View File

@ -188,6 +188,7 @@ class Backend extends Api
$search = $this->request->get("search/a", []);
$initKey = $this->request->get("initKey/s", $pk);
$initValue = $this->request->get("initValue", '');
$operator = $this->request->get("operator/s", 'in');
$where = [];
$modelTable = strtolower($this->model->getTable());
@ -203,7 +204,7 @@ class Backend extends Api
$where[] = [implode("|", $quickSearchArr), "LIKE", '%' . str_replace('%', '\%', $quickSearch) . '%'];
}
if ($initValue) {
$where[] = [$initKey, 'in', $initValue];
$where[] = [$initKey, $operator, $initValue];
$limit = 999999;
}