fix conflict with where clause in indicator ; initiate a filter test

This commit is contained in:
2022-07-20 23:17:05 +02:00
parent 0d38d4df40
commit d5d3866122
5 changed files with 71 additions and 11 deletions

View File

@@ -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;

View File

@@ -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)
;

View File

@@ -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));

View File

@@ -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']);