mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
[activity report count] do not count activities from centers not selected
This commit is contained in:
parent
8503628d96
commit
efe27bf100
6
CHANGELOG.md
Normal file
6
CHANGELOG.md
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
Master branch
|
||||
=============
|
||||
|
||||
- [report activity count] fix error: do not show centers which are not selected in results.
|
||||
|
@ -69,6 +69,7 @@ class CountActivity implements ExportInterface
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
|
||||
{
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
$centers = array_map(function($el) { return $el['center']; }, $acl);
|
||||
|
||||
$qb->select('COUNT(activity.id) as export_count_activity')
|
||||
->from('ChillActivityBundle:Activity', 'activity')
|
||||
@ -78,6 +79,10 @@ class CountActivity implements ExportInterface
|
||||
$qb->join('activity.person', 'person');
|
||||
}
|
||||
|
||||
$qb->where($qb->expr()->in('person.center', ':centers'))
|
||||
->setParameter('centers', $centers)
|
||||
;
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user