fixes #419
This commit is contained in:
parent
7c857b67c1
commit
201c6b8194
@ -35,7 +35,7 @@ class Doctrine_Query_Groupby extends Doctrine_Query_Part
|
|||||||
/**
|
/**
|
||||||
* DQL GROUP BY PARSER
|
* DQL GROUP BY PARSER
|
||||||
* parses the group by part of the query string
|
* parses the group by part of the query string
|
||||||
|
*
|
||||||
* @param string $str
|
* @param string $str
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -45,11 +45,17 @@ class Doctrine_Query_Groupby extends Doctrine_Query_Part
|
|||||||
foreach (explode(',', $str) as $reference) {
|
foreach (explode(',', $str) as $reference) {
|
||||||
$reference = trim($reference);
|
$reference = trim($reference);
|
||||||
$e = explode('.', $reference);
|
$e = explode('.', $reference);
|
||||||
|
|
||||||
|
if (count($e) > 1) {
|
||||||
$field = array_pop($e);
|
$field = array_pop($e);
|
||||||
$ref = implode('.', $e);
|
$ref = implode('.', $e);
|
||||||
$this->query->load($ref);
|
$this->query->load($ref);
|
||||||
|
|
||||||
$r[] = $this->query->getTableAlias($ref) . '.' . $field;
|
$r[] = $this->query->getTableAlias($ref) . '.' . $field;
|
||||||
|
} else {
|
||||||
|
$alias = end($e);
|
||||||
|
$r[] = $this->query->getAggregateAlias($alias);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return implode(', ', $r);
|
return implode(', ', $r);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user