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.
This commit is contained in:
Julie Lenaerts 2024-07-17 15:38:55 +02:00
parent 681f637d13
commit 20af766cdf

View File

@ -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