mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Fixed: [export][activity type filter for acp] fix filter for acp, by activity type
Use an `EXISTS` subquery instead of a JOIN.
This commit is contained in:
parent
e7ac8aafe1
commit
5fea61c450
@ -44,14 +44,13 @@ class ActivityTypeFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!in_array('activity', $qb->getAllAliases(), true)) {
|
$qb->andWhere(
|
||||||
$qb->join(Activity::class, 'activity', Expr\Join::WITH, 'activity.accompanyingPeriod = acp');
|
$qb->expr()->exists(
|
||||||
}
|
'SELECT 1 FROM '.Activity::class.' act_type_filter_activity
|
||||||
|
WHERE act_type_filter_activity.activityType IN (:act_type_filter_activity_types) AND act_type_filter_activity.accompanyingPeriod = acp'
|
||||||
$clause = $qb->expr()->in('activity.activityType', ':selected_activity_types');
|
)
|
||||||
|
);
|
||||||
$qb->andWhere($clause);
|
$qb->setParameter('act_type_filter_activity_types', $data['accepted_activitytypes']);
|
||||||
$qb->setParameter('selected_activity_types', $data['types']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user