exports: add condition with distinct alias on join clauses

This commit is contained in:
2022-09-07 19:58:38 +02:00
parent 81359877c4
commit 1dcff2f23c
49 changed files with 343 additions and 220 deletions

View File

@@ -41,7 +41,9 @@ class CancelReasonAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
// TODO: still needs to take into account appointments without a cancel reason somehow
$qb->join('cal.cancelReason', 'cr');
if (!in_array('calcancel', $qb->getAllAliases(), true)) {
$qb->join('cal.cancelReason', 'calcancel');
}
$qb->addSelect('IDENTITY(cal.cancelReason) as cancel_reason_aggregator');