diff --git a/framework/yii/db/ActiveQuery.php b/framework/yii/db/ActiveQuery.php index 068c713..f87422a 100644 --- a/framework/yii/db/ActiveQuery.php +++ b/framework/yii/db/ActiveQuery.php @@ -243,10 +243,16 @@ class ActiveQuery extends Query implements ActiveQueryInterface unset($with[$name]); } } - $this->with($with); - } elseif ($eagerLoading) { - $this->with($with); + } elseif (!$eagerLoading) { + $with = []; } + + if (!empty($with)) { + foreach ($with as $name => $value) { + $this->with[$name] = $value; + } + } + return $this; }