This commit is contained in:
2020-09-08 01:21:07 +08:00
parent 51b79ed1ea
commit 17093acb9f
2 changed files with 24 additions and 7 deletions
+11 -2
View File
@@ -234,9 +234,18 @@ class ActiveQuery extends Component
* @return ActiveRecord
* @throws Exception
*/
private function populate($model, $data)
public function populate($model, $data)
{
return $this->getWith($model::populate($data));
}
/**
* @param $model
* @return mixed
*/
public function getWith($model)
{
$model = $model::populate($data);
if (empty($this->with) || !is_array($this->with)) {
return $model;
}