From d2029e94a02d47ad79e627dc4935eed2fb81dfd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 20 Apr 2023 22:37:22 +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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ActiveQuery.php b/ActiveQuery.php index 247505f..2533fbd 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -262,7 +262,8 @@ class ActiveQuery extends Component implements ISqlBuilder */ public function count(): int { - $data = $this->execute($this->builder->count())->one(); + $builder = clone $this->builder; + $data = $this->execute($builder->count())->one(); if ($data && is_array($data)) { return (int)array_shift($data); }