mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix count_accompanying_course query: no centers, not count DRAFT courses
This commit is contained in:
parent
e323937405
commit
3d0dd46ea5
@ -87,17 +87,15 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
$expr = $qb->expr();
|
||||
|
||||
$qb->select('COUNT(acp.id) AS export_result')
|
||||
->from('ChillPersonBundle:AccompanyingPeriod', 'acp')
|
||||
->join('acp.center', 'center')
|
||||
->andWhere('center IN (:authorized_centers)')
|
||||
->setParameter('authorized_centers', $centers);
|
||||
->where($expr->neq(
|
||||
'acp.step', $expr->literal('DRAFT')
|
||||
))
|
||||
;
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user