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

@@ -40,9 +40,11 @@ final class JobAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
$qb->join('cal.user', 'u');
if (!in_array('caluser', $qb->getAllAliases(), true)) {
$qb->join('cal.user', 'caluser');
}
$qb->addSelect('IDENTITY(u.userJob) as job_aggregator');
$qb->addSelect('IDENTITY(caluser.userJob) as job_aggregator');
$groupBy = $qb->getDQLPart('groupBy');