mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-22 15:24:09 +00:00
feat:增加搜索关键词包含百分号时的处理 !127
This commit is contained in:
parent
d6e37e0486
commit
3b770b5fcc
@ -172,7 +172,7 @@ class Backend extends Api
|
||||
foreach ($quickSearchArr as $k => $v) {
|
||||
$quickSearchArr[$k] = stripos($v, ".") === false ? $tableAlias . $v : $v;
|
||||
}
|
||||
$where[] = [implode("|", $quickSearchArr), "LIKE", "%{$quickSearch}%"];
|
||||
$where[] = [implode("|", $quickSearchArr), "LIKE", '%' . str_replace('%', '\%', $quickSearch) . '%'];
|
||||
}
|
||||
if ($initValue) {
|
||||
$where[] = [$initKey, 'in', $initValue];
|
||||
@ -254,7 +254,7 @@ class Backend extends Api
|
||||
break;
|
||||
case 'LIKE':
|
||||
case 'NOT LIKE':
|
||||
$where[] = [$fieldName, $field['operator'], "%{$field['val']}%"];
|
||||
$where[] = [$fieldName, $field['operator'], '%' . str_replace('%', '\%', $field['val']) . '%'];
|
||||
break;
|
||||
case '>':
|
||||
case '>=':
|
||||
|
Loading…
Reference in New Issue
Block a user