This commit is contained in:
2020-09-08 01:17:35 +08:00
parent 3680ab1dfb
commit 51b79ed1ea
3 changed files with 8 additions and 9 deletions
+4 -7
View File
@@ -218,13 +218,10 @@ class ActiveQuery extends Component
*/
public function all()
{
$data = $this->modelClass::getDb()
->createCommand($this->queryBuilder())
->all();
$collect = new Collection($this);
$collect->setModel($this->modelClass);
$collect->setItems($data);
$collect = new Collection($this,
$this->modelClass::getDb()->createCommand($this->queryBuilder())->all()
, $this->modelClass
);
if ($this->asArray) {
return $collect->toArray();
}