From d4cf6da9fedd78da3c1b58b67752149992716e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 8 Apr 2022 19:18:02 +0800 Subject: [PATCH] modify mysql result --- ActiveQuery.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ActiveQuery.php b/ActiveQuery.php index d74b49b..1d0798f 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -221,13 +221,16 @@ class ActiveQuery extends Component implements ISqlBuilder return $this->all()->column($field, $setKey); } + /** * @return array|Collection * @throws */ 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)) { $this->getWith($this->modelClass); }