变更
This commit is contained in:
+2
-4
@@ -238,10 +238,8 @@ class ActiveQuery extends Component implements ISqlBuilder
|
|||||||
|
|
||||||
$this->getWith($this->modelClass);
|
$this->getWith($this->modelClass);
|
||||||
$collect = new Collection($this, $data, $this->modelClass);
|
$collect = new Collection($this, $data, $this->modelClass);
|
||||||
if ($this->asArray) {
|
|
||||||
return $collect->toArray();
|
return $this->asArray ? $collect->toArray() : $collect;
|
||||||
}
|
|
||||||
return $collect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -279,9 +279,6 @@ class Model extends Base\Model
|
|||||||
*/
|
*/
|
||||||
private function withRelates($relates): array
|
private function withRelates($relates): array
|
||||||
{
|
{
|
||||||
if (!$this->hasWith()) {
|
|
||||||
return $relates;
|
|
||||||
}
|
|
||||||
foreach ($this->getWith() as $val) {
|
foreach ($this->getWith() as $val) {
|
||||||
$relates[$val] = $this->withRelate($val);
|
$relates[$val] = $this->withRelate($val);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user