From 20af766cdf5475da7ae4bce6a91185bd8f6033f2 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 17 Jul 2024 15:38:55 +0200 Subject: [PATCH] Fix the query to return the count of events Left join was causing events to counted multiple times (once per participation). Using DISTINCT fixes this. --- src/Bundle/ChillEventBundle/Export/Export/CountEvents.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php b/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php index 6ecfa3f43..7cb98b5a6 100644 --- a/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php +++ b/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php @@ -94,7 +94,7 @@ readonly class CountEvents implements ExportInterface, GroupedExportInterface ->leftJoin('event.participations', 'epart') ->leftJoin('epart.person', 'person'); - $qb->select('COUNT(event.id) as export_count_event'); + $qb->select('COUNT(DISTINCT event.id) as export_count_event'); if ($this->filterStatsByCenters) { $qb