mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Fix query in filter: period having activity between dates filter
Adding statement to ensure that subquery only considers records that are identical to the ones being processed in the main query.
This commit is contained in:
@@ -73,13 +73,15 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
||||
|
||||
$qb->andWhere(
|
||||
$qb->expr()->exists(
|
||||
'SELECT 1 FROM '.Activity::class." {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = acp"
|
||||
'SELECT 1 FROM '.Activity::class." {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = activity.accompanyingPeriod AND {$alias}.id = activity.id"
|
||||
)
|
||||
);
|
||||
|
||||
$qb
|
||||
->setParameter($from, $this->rollingDateConverter->convert($data['start_date']))
|
||||
->setParameter($to, $this->rollingDateConverter->convert($data['end_date']));
|
||||
|
||||
dump($qb->getQuery()->getResult());
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
|
Reference in New Issue
Block a user