This commit is contained in:
2020-09-11 17:34:15 +08:00
parent e4bb04c678
commit 2d789b3494
+4 -5
View File
@@ -218,10 +218,9 @@ class ActiveQuery extends Component
*/ */
public function all() public function all()
{ {
$collect = new Collection($this, $collect = new Collection($this, $this->modelClass::getDb()
$this->modelClass::getDb()->createCommand($this->queryBuilder())->all() ->createCommand($this->queryBuilder())
, $this->modelClass ->all(), $this->modelClass);
);
if ($this->asArray) { if ($this->asArray) {
return $collect->toArray(); return $collect->toArray();
} }
@@ -234,7 +233,7 @@ class ActiveQuery extends Component
* @return ActiveRecord * @return ActiveRecord
* @throws Exception * @throws Exception
*/ */
public function populate($model, $data) public function populate(ActiveRecord $model, $data)
{ {
return $this->getWith($model::populate($data)); return $this->getWith($model::populate($data));
} }