|
@@ -5,6 +5,7 @@ namespace Dcat\Admin\Grid\Concerns;
|
|
|
use Dcat\Admin\Grid\Column;
|
|
|
use Dcat\Admin\Grid\Model;
|
|
|
use Dcat\Admin\Grid\Tools;
|
|
|
+use Dcat\Admin\Support\Helper;
|
|
|
use Illuminate\Support\Collection;
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
@@ -99,6 +100,7 @@ trait HasQuickSearch
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ // 树表格子节点忽略查询条件
|
|
|
$this->model()
|
|
|
->disableBindTreeQuery()
|
|
|
->treeUrlWithoutQuery(
|
|
@@ -233,7 +235,7 @@ trait HasQuickSearch
|
|
|
$likeOperator = 'like';
|
|
|
$method = $or ? 'orWhere' : 'where';
|
|
|
|
|
|
- $query->{$method}($column, $likeOperator, $pattern);
|
|
|
+ Helper::withQueryCondition($query, $column, $method, [$likeOperator, $pattern]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -249,7 +251,7 @@ trait HasQuickSearch
|
|
|
{
|
|
|
$method = ($or ? 'orWhere' : 'where').ucfirst($function);
|
|
|
|
|
|
- $query->$method($column, $value);
|
|
|
+ Helper::withQueryCondition($query, $column, $method, [$value]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -274,7 +276,7 @@ trait HasQuickSearch
|
|
|
$where = $or ? 'orWhere' : 'where';
|
|
|
$method = $where.($not ? 'NotIn' : 'In');
|
|
|
|
|
|
- $query->$method($column, $values);
|
|
|
+ Helper::withQueryCondition($query, $column, $method, [$values]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -290,7 +292,7 @@ trait HasQuickSearch
|
|
|
{
|
|
|
$method = $or ? 'orWhereBetween' : 'whereBetween';
|
|
|
|
|
|
- $query->$method($column, [$start, $end]);
|
|
|
+ Helper::withQueryCondition($query, $column, $method, [[$start, $end]]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -319,6 +321,6 @@ trait HasQuickSearch
|
|
|
$value = substr($value, 1, -1);
|
|
|
}
|
|
|
|
|
|
- $query->{$method}($column, $operator, $value);
|
|
|
+ Helper::withQueryCondition($query, $column, $method, [$operator, $value]);
|
|
|
}
|
|
|
}
|