diff --git a/Database/ActiveQuery.php b/Database/ActiveQuery.php index 7823512e..8a8c1786 100644 --- a/Database/ActiveQuery.php +++ b/Database/ActiveQuery.php @@ -257,6 +257,7 @@ class ActiveQuery extends Component implements ISqlBuilder */ public function count(): int { + $this->select = ['COUNT(*)']; $data = $this->execute($this->builder->count())->one(); if ($data && is_array($data)) { return (int)array_shift($data);