关联模型下时间无法搜索的BUG,仅在关联搜索条件下调用

pull/429/head
bran 2023-02-10 15:44:48 +08:00
parent 242d670b5a
commit 9f1c1db03c
1 changed files with 2 additions and 1 deletions

View File

@ -397,7 +397,8 @@ class Backend extends Controller
$arr = $arr[0];
}
$tableArr = explode('.', $k);
if (count($tableArr) > 1 && $tableArr[0] != $name && !in_array($tableArr[0], $alias) && !empty($this->model)) {
if (count($tableArr) > 1 && $tableArr[0] != $name && !in_array($tableArr[0], $alias)
&& !empty($this->model) && $this->relationSearch) {
//修复关联模型下时间无法搜索的BUG
$relation = Loader::parseName($tableArr[0], 1, false);
$alias[$this->model->$relation()->getTable()] = $tableArr[0];