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

pull/430/head
bran 2023-02-10 15:44:13 +08:00
parent 9e9d729c62
commit a1097cbdc7
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];