作者 Karson

修复关联主表时间字段无法搜索的BUG

... ... @@ -273,6 +273,7 @@ class Backend extends Controller
$op = (array)json_decode($op, true);
$filter = $filter ? $filter : [];
$where = [];
$name = '';
$tableName = '';
if ($relationSearch) {
if (!empty($this->model)) {
... ... @@ -384,7 +385,7 @@ class Backend extends Controller
$arr = $arr[0];
}
$tableArr = explode('.', $k);
if (count($tableArr) > 1) {
if (count($tableArr) > 1 && $tableArr[0] != $name) {
//修复关联模型下时间无法搜索的BUG
$relation = Loader::parseName($tableArr[0], 1, false);
$this->model->alias([$this->model->$relation()->getTable() => $tableArr[0]]);
... ...