mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
fix conflict with where clause in indicator ; initiate a filter test
This commit is contained in:
@@ -93,9 +93,6 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
|
||||
|
||||
$qb->select('COUNT(acp.id) AS export_result')
|
||||
->from('ChillPersonBundle:AccompanyingPeriod', 'acp')
|
||||
->where($expr->neq(
|
||||
'acp.step', $expr->literal('DRAFT')
|
||||
))
|
||||
;
|
||||
|
||||
return $qb;
|
||||
|
@@ -131,9 +131,6 @@ class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportIn
|
||||
ELSE :force_closingDate
|
||||
END ) - acp.openingDate
|
||||
) AS export_result')
|
||||
->where($expr->neq(
|
||||
'acp.step', $expr->literal('DRAFT')
|
||||
))
|
||||
->setParameter('force_closingDate', $force_closingdate)
|
||||
;
|
||||
|
||||
|
@@ -82,10 +82,10 @@ class SocialIssueFilter implements FilterInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->join('acp.socialIssues', 's');
|
||||
$qb->join('acp.socialIssues', 'si');
|
||||
|
||||
$where = $qb->getDQLPart('where');
|
||||
$clause = $qb->expr()->in('s.id', ':socialissues');
|
||||
$clause = $qb->expr()->in('si.id', ':socialissues');
|
||||
|
||||
if ($where instanceof Andx) {
|
||||
$where->add($clause);
|
||||
@@ -128,7 +128,7 @@ class SocialIssueFilter implements FilterInterface
|
||||
return $item->getId();
|
||||
}, $array);
|
||||
|
||||
$unique_ids = array_unique($ids); dump($unique_ids);
|
||||
$unique_ids = array_unique($ids);
|
||||
|
||||
return array_values(
|
||||
array_intersect_key($array, $unique_ids));
|
||||
|
@@ -70,8 +70,11 @@ class StepFilter implements FilterInterface
|
||||
$where = $qb->getDQLPart('where');
|
||||
$clause = $qb->expr()->eq('acp.step', ':step');
|
||||
|
||||
// override original where clause
|
||||
$where = $qb->expr()->andX($clause);
|
||||
if ($where instanceof Andx) {
|
||||
$where->add($clause);
|
||||
} else {
|
||||
$where = $qb->expr()->andX($clause);
|
||||
}
|
||||
|
||||
$qb->add('where', $where);
|
||||
$qb->setParameter('step', $data['accepted_step']);
|
||||
|
Reference in New Issue
Block a user