fixed params in Query to allow execution twice

fixes #1545
This commit is contained in:
Carsten Brandt
2013-12-17 13:19:54 +01:00
parent d6866256df
commit 2febbebb44
2 changed files with 3 additions and 3 deletions

View File

@ -122,7 +122,6 @@ class ActiveQuery extends Query implements ActiveQueryInterface
$db = $modelClass::getDb();
}
$params = $this->params;
if ($this->sql === null) {
if ($this->from === null) {
$tableName = $modelClass::tableName();
@ -131,8 +130,8 @@ class ActiveQuery extends Query implements ActiveQueryInterface
}
$this->from = [$tableName];
}
list ($this->sql, $params) = $db->getQueryBuilder()->build($this);
list ($this->sql, $this->params) = $db->getQueryBuilder()->build($this);
}
return $db->createCommand($this->sql, $params);
return $db->createCommand($this->sql, $this->params);
}
}