This commit is contained in:
Qiang Xue
2014-01-07 09:50:37 -05:00
parent daf6c81f27
commit 9ceaf3bd1c

View File

@ -249,7 +249,13 @@ class ActiveQuery extends Query implements ActiveQueryInterface
if (!empty($with)) { if (!empty($with)) {
foreach ($with as $name => $value) { foreach ($with as $name => $value) {
$this->with[$name] = $value; if (is_integer($name)) {
if (!in_array($value, $this->with, true) && !isset($this->with[$value])) {
$this->with[] = $value;
}
} elseif (!isset($this->with[$name])) {
$this->with[$name] = $value;
}
} }
} }