修正关联

This commit is contained in:
thinkphp
2017-11-25 10:54:20 +08:00
parent 6381d65bb3
commit a4b5d8908f
2 changed files with 2 additions and 1 deletions

View File

@@ -185,7 +185,7 @@ class HasMany extends Relation
if ($closure) {
call_user_func_array($closure, [ & $model]);
}
$list = $model->where($where)->with($subRelation)->select();
$list = $model->removeWhereField($foreignKey)->where($where)->with($subRelation)->select();
// 组装模型数据
$data = [];