modify mysql result

This commit is contained in:
2022-04-08 19:18:02 +08:00
parent 2057f2ef53
commit d4cf6da9fe
+4 -1
View File
@@ -221,13 +221,16 @@ class ActiveQuery extends Component implements ISqlBuilder
return $this->all()->column($field, $setKey); return $this->all()->column($field, $setKey);
} }
/** /**
* @return array|Collection * @return array|Collection
* @throws * @throws
*/ */
public function all(): Collection|array public function all(): Collection|array
{ {
$data = $this->execute($this->builder->all())->all(); if (($data = $this->execute($this->builder->all())->all()) == false) {
return new Collection($this, [], $this->modelClass);
}
if (!empty($this->with)) { if (!empty($this->with)) {
$this->getWith($this->modelClass); $this->getWith($this->modelClass);
} }