Fix: [export][aggregator] group by user job, not by job

This commit is contained in:
Mathieu Jaumotte 2023-01-25 11:55:13 +01:00
parent de5f818c5a
commit 050a4feab5

View File

@ -40,11 +40,11 @@ final class JobAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('acpjob', $qb->getAllAliases(), true)) {
$qb->leftJoin('acp.job', 'acpjob');
if (!in_array('acpuser', $qb->getAllAliases(), true)) {
$qb->leftJoin('acp.user', 'acpuser');
}
$qb->addSelect('IDENTITY(acp.job) AS job_aggregator');
$qb->addSelect('IDENTITY(acpuser.userJob) AS job_aggregator');
$qb->addGroupBy('job_aggregator');
}