Browse Source

修复表格搜索多个关联表字段sql错误问题

jqh 4 years ago
parent
commit
6ac6596c37
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Support/Helper.php

+ 2 - 2
src/Support/Helper.php

@@ -798,8 +798,8 @@ class Helper
         $method = $query === 'orWhere' ? 'orWhere' : 'where';
         $subQuery = $query === 'orWhere' ? 'where' : $query;
 
-        $model->$method(function () use ($model, $column, $subQuery, $params) {
-            static::withRelationQuery($model, $column, $subQuery, $params);
+        $model->$method(function ($q) use ($column, $subQuery, $params) {
+            static::withRelationQuery($q, $column, $subQuery, $params);
         });
     }