Use automatically a subquery when counting with groups

This commit is contained in:
Eric Lippmann 2014-11-13 16:33:10 +01:00 committed by Johannes Meyer
parent 77f5bc3932
commit 0e34001568
1 changed files with 1 additions and 1 deletions

View File

@ -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);