DX: fixed complicated comparison to add a group by

This commit is contained in:
2022-10-06 23:42:46 +02:00
parent 1b1aaaa862
commit 07d15f0a68
5 changed files with 5 additions and 32 deletions

View File

@@ -46,14 +46,7 @@ final class AgentAggregator implements AggregatorInterface
}
$qb->addSelect('caluser.id AS agent_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('agent_aggregator');
} else {
$qb->groupBy('agent_aggregator');
}
$qb->addGroupBy('agent_aggregator');
}
public function applyOn(): string

View File

@@ -47,14 +47,7 @@ class CancelReasonAggregator implements AggregatorInterface
}
$qb->addSelect('IDENTITY(cal.cancelReason) as cancel_reason_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('cancel_reason_aggregator');
} else {
$qb->groupBy('cancel_reason_aggregator');
}
$qb->addGroupBy('cancel_reason_aggregator');
}
public function applyOn(): string

View File

@@ -46,14 +46,7 @@ final class JobAggregator implements AggregatorInterface
}
$qb->addSelect('IDENTITY(caluser.userJob) as job_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('job_aggregator');
} else {
$qb->groupBy('job_aggregator');
}
$qb->addGroupBy('job_aggregator');
}
public function applyOn(): string

View File

@@ -46,14 +46,7 @@ final class LocationTypeAggregator implements AggregatorInterface
}
$qb->addSelect('IDENTITY(calloc.locationType) as location_type_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('location_type_aggregator');
} else {
$qb->groupBy('location_type_aggregator');
}
$qb->addGroupBy('location_type_aggregator');
}
public function applyOn(): string