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