修正关联

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

@@ -1239,6 +1239,7 @@ class Query
$logic = strtoupper($logic); $logic = strtoupper($logic);
if (isset($this->options['where'][$logic][$field])) { if (isset($this->options['where'][$logic][$field])) {
unset($this->options['where'][$logic][$field]); unset($this->options['where'][$logic][$field]);
unset($this->options['multi'][$logic][$field]);
} }
return $this; return $this;
} }

View File

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