浏览代码

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

jqh 4 年之前
父节点
当前提交
6ac6596c37
共有 1 个文件被更改,包括 2 次插入2 次删除
  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);
         });
     }