mirror of https://gitee.com/karson/fastadmin.git
!227 文件、图片、权重等字段默认不加入搜索栏,字符串类型默认LIKE
Merge pull request !227 from 开兴/add-search-filterpull/227/MERGE
commit
66e69dfd26
|
|
@ -1449,6 +1449,15 @@ EOD;
|
||||||
if ($itemArr) {
|
if ($itemArr) {
|
||||||
$html .= ", searchList: " . $searchList;
|
$html .= ", searchList: " . $searchList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 文件、图片、权重等字段默认不加入搜索栏,字符串类型默认LIKE
|
||||||
|
$noSearchFiles = ['file$', 'files$', 'image$', 'images$', '^weigh$'];
|
||||||
|
if(preg_match("/" . implode('|', $noSearchFiles) . "/i", $field)){
|
||||||
|
$html .= ", operate: false";
|
||||||
|
}else if(in_array($datatype, ['varchar'])) {
|
||||||
|
$html .= ", operate: 'LIKE'";
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array($datatype, ['date', 'datetime']) || $formatter === 'datetime') {
|
if (in_array($datatype, ['date', 'datetime']) || $formatter === 'datetime') {
|
||||||
$html .= ", operate:'RANGE', addclass:'datetimerange'";
|
$html .= ", operate:'RANGE', addclass:'datetimerange'";
|
||||||
} elseif (in_array($datatype, ['float', 'double', 'decimal'])) {
|
} elseif (in_array($datatype, ['float', 'double', 'decimal'])) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue