This commit is contained in:
2023-04-01 15:58:17 +08:00
parent c805173600
commit 509eabe78e
2 changed files with 2 additions and 7 deletions
+2 -4
View File
@@ -238,10 +238,8 @@ class ActiveQuery extends Component implements ISqlBuilder
$this->getWith($this->modelClass);
$collect = new Collection($this, $data, $this->modelClass);
if ($this->asArray) {
return $collect->toArray();
}
return $collect;
return $this->asArray ? $collect->toArray() : $collect;
}
/**
-3
View File
@@ -279,9 +279,6 @@ class Model extends Base\Model
*/
private function withRelates($relates): array
{
if (!$this->hasWith()) {
return $relates;
}
foreach ($this->getWith() as $val) {
$relates[$val] = $this->withRelate($val);
}