From 36b0844e796f87815a25be16b4749c4734f7fd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 24 Oct 2023 14:17:28 +0200 Subject: [PATCH] Fix issue with duration aggregator as month --- .../AccompanyingCourseAggregators/DurationAggregator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php index 5d0b0e87f..f5dc99115 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php @@ -38,7 +38,7 @@ final readonly class DurationAggregator implements AggregatorInterface match ($data['precision']) { 'day' => $qb->addSelect('(COALESCE(acp.closingDate, :now) - acp.openingDate) AS duration_aggregator'), 'week' => $qb->addSelect('(COALESCE(acp.closingDate, :now) - acp.openingDate) / 7 AS duration_aggregator'), - 'month' => $qb->addSelect('(EXTRACT (MONTH FROM AGE(COALESCE(acp.closingDate, :now), acp.openingDate)) * 12 + + 'month' => $qb->addSelect('(EXTRACT (YEAR FROM AGE(COALESCE(acp.closingDate, :now), acp.openingDate)) * 12 + EXTRACT (MONTH FROM AGE(COALESCE(acp.closingDate, :now), acp.openingDate))) AS duration_aggregator'), default => throw new \LogicException('precision not supported: '.$data['precision']), };