From 7d8ed087f57be7155c38c55bdbadae045624a800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 25 Apr 2023 17:36:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ActiveQuery.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ActiveQuery.php b/ActiveQuery.php index 247505f..58bd37e 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -230,7 +230,7 @@ class ActiveQuery extends Component implements ISqlBuilder */ public function all(): Collection|array { - $data = $this->execute($this->builder->all())->all(); + $data = $this->execute($this->builder->all(), $this->attributes)->all(); if ($data === false) { return new Collection($this, [], $this->modelClass); } @@ -262,7 +262,7 @@ class ActiveQuery extends Component implements ISqlBuilder */ public function count(): int { - $data = $this->execute($this->builder->count())->one(); + $data = $this->execute($this->builder->count(), $this->attributes)->one(); if ($data && is_array($data)) { return (int)array_shift($data); } @@ -317,7 +317,7 @@ class ActiveQuery extends Component implements ISqlBuilder */ public function exists(): bool { - return !empty($this->execute($this->builder->one())->fetchColumn()); + return !empty($this->execute($this->builder->one(), $this->attributes)->fetchColumn()); } @@ -330,7 +330,7 @@ class ActiveQuery extends Component implements ISqlBuilder { $sql = $this->builder->delete(); if ($getSql === FALSE) { - return (bool)$this->execute($sql)->delete(); + return (bool)$this->execute($sql, $this->attributes)->delete(); } return $sql; }