This commit is contained in:
2021-04-20 11:34:18 +08:00
parent 676fb95d32
commit e2a562107d
+1
View File
@@ -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);