This commit is contained in:
2021-11-09 13:58:08 +08:00
parent f8718fa4de
commit 8c98ce8c7f
3 changed files with 13 additions and 9 deletions
+1 -3
View File
@@ -237,9 +237,7 @@ class ActiveQuery extends Component implements ISqlBuilder
*/
public function count(): int
{
$clone = clone $this;
$clone->select = ['COUNT(*)'];
$data = $this->execute($clone->builder->count())->one();
$data = $this->execute($this->builder->count())->one();
if ($data && is_array($data)) {
return (int)array_shift($data);
}