mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix issue with duration aggregator as month
This commit is contained in:
parent
7bff5ce39e
commit
36b0844e79
@ -38,7 +38,7 @@ final readonly class DurationAggregator implements AggregatorInterface
|
|||||||
match ($data['precision']) {
|
match ($data['precision']) {
|
||||||
'day' => $qb->addSelect('(COALESCE(acp.closingDate, :now) - acp.openingDate) AS duration_aggregator'),
|
'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'),
|
'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'),
|
EXTRACT (MONTH FROM AGE(COALESCE(acp.closingDate, :now), acp.openingDate))) AS duration_aggregator'),
|
||||||
default => throw new \LogicException('precision not supported: '.$data['precision']),
|
default => throw new \LogicException('precision not supported: '.$data['precision']),
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user