diff --git a/ActiveQuery.php b/ActiveQuery.php index 841fdf4..c9fd4e8 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -154,7 +154,7 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder */ public function count(): int { - return $this->buildCommand($this->builder->count())->rowCount(); + return $this->buildCommand($this->select(['count(*)'])->builder->count())->rowCount(); }