Use automatically a subquery when counting with groups
This commit is contained in:
parent
77f5bc3932
commit
0e34001568
|
@ -269,7 +269,7 @@ class DbQuery extends SimpleQuery
|
|||
$count = $this->dbSelect();
|
||||
|
||||
$this->applyFilterSql($count);
|
||||
if ($this->useSubqueryCount) {
|
||||
if ($this->useSubqueryCount || $this->group) {
|
||||
$count->columns($this->columns);
|
||||
$columns = array('cnt' => 'COUNT(*)');
|
||||
return $this->db->select()->from($count, $columns);
|
||||
|
|
Loading…
Reference in New Issue