Browse Source

Fixes #1791

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
daf6c81f27
  1. 12
      framework/yii/db/ActiveQuery.php

12
framework/yii/db/ActiveQuery.php

@ -243,10 +243,16 @@ class ActiveQuery extends Query implements ActiveQueryInterface
unset($with[$name]); unset($with[$name]);
} }
} }
$this->with($with); } elseif (!$eagerLoading) {
} elseif ($eagerLoading) { $with = [];
$this->with($with);
} }
if (!empty($with)) {
foreach ($with as $name => $value) {
$this->with[$name] = $value;
}
}
return $this; return $this;
} }

Loading…
Cancel
Save