This commit is contained in:
2024-04-26 15:20:22 +08:00
parent 8acf74c9ed
commit 4341efcb8c
+2 -1
View File
@@ -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);
}