DX: do not use complicated condtiion to add a group by

This commit is contained in:
2022-10-06 23:24:07 +02:00
parent c7de95c635
commit f5997e39cd
3 changed files with 4 additions and 27 deletions

View File

@@ -40,14 +40,7 @@ final class LocationAggregator implements AggregatorInterface
$qb->join('cal.location', 'calloc');
}
$qb->addSelect('IDENTITY(cal.location) as location_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('location_aggregator');
} else {
$qb->groupBy('location_aggregator');
}
$qb->addGroupBy('location_aggregator');
}
public function applyOn(): string