eee
This commit is contained in:
+1
-3
@@ -154,9 +154,7 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
$clone = clone $this;
|
$search = $this->buildCommand($this->builder->count())->one();
|
||||||
$clone->select(['count(*)']);
|
|
||||||
$search = $clone->buildCommand($clone->builder->count())->one();
|
|
||||||
return !$search ? 0 : current($search);
|
return !$search ? 0 : current($search);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -235,7 +235,7 @@ class SqlBuilder extends Component
|
|||||||
*/
|
*/
|
||||||
public function count(): string
|
public function count(): string
|
||||||
{
|
{
|
||||||
return $this->makeSelect($this->query->select) . $this->make();
|
return $this->makeSelect(['COUNT(*)']) . $this->make();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user