Commit f3c26d3c by Qiang Xue

Fixes #2880.

parent 85412adb
......@@ -349,6 +349,9 @@ class ActiveQuery extends Query implements ActiveQueryInterface
private function buildJoinWith()
{
$join = $this->join;
$this->join = [];
foreach ($this->joinWith as $config) {
list ($with, $eagerLoading, $joinType) = $config;
$this->joinWithRelations(new $this->modelClass, $with, $joinType);
......@@ -369,6 +372,12 @@ class ActiveQuery extends Query implements ActiveQueryInterface
$this->with($with);
}
if (!empty($join)) {
// append explicit join to joinWith()
// https://github.com/yiisoft/yii2/issues/2880
$this->join = empty($this->join) ? $join : array_merge($this->join, $join);
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment