From f9ee3aa014c23992f2b724f7a1f0f0cde3e5a66f Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 26 Apr 2024 15:22:16 +0800 Subject: [PATCH] eee --- ActiveQuery.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ActiveQuery.php b/ActiveQuery.php index f1839a4..07b142e 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -154,7 +154,9 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder */ public function count(): int { - $search = $this->buildCommand((clone $this)->select(['count(*)'])->builder->count())->one(); + $clone = clone $this; + $clone->select(['count(*)']); + $search = $clone->buildCommand($clone->builder->count())->one(); return !$search ? 0 : current($search); }