mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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:
parent
b42473b01d
commit
5b0019cde7
@ -73,13 +73,15 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
|
|
||||||
$qb->andWhere(
|
$qb->andWhere(
|
||||||
$qb->expr()->exists(
|
$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
|
$qb
|
||||||
->setParameter($from, $this->rollingDateConverter->convert($data['start_date']))
|
->setParameter($from, $this->rollingDateConverter->convert($data['start_date']))
|
||||||
->setParameter($to, $this->rollingDateConverter->convert($data['end_date']));
|
->setParameter($to, $this->rollingDateConverter->convert($data['end_date']));
|
||||||
|
|
||||||
|
dump($qb->getQuery()->getResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user