mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-26 00:24:59 +00:00
exports: add condition with distinct alias on join clauses
This commit is contained in:
@@ -84,8 +84,11 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->activityRepository->createQueryBuilder('activity')
|
||||
->join('activity.person', 'person');
|
||||
$qb = $this->activityRepository->createQueryBuilder('activity');
|
||||
|
||||
if (!in_array('actperson', $qb->getAllAliases(), true)) {
|
||||
$qb->join('activity.person', 'actperson');
|
||||
}
|
||||
|
||||
$qb->select('COUNT(activity.id) as export_count_activity');
|
||||
|
||||
|
Reference in New Issue
Block a user