fix: don't show past assignments in teamers' overview

This commit is contained in:
Björn Fromme
2023-12-01 11:55:50 +01:00
parent feb06ecf64
commit ec22e31eb9
+11 -1
View File
@@ -55,10 +55,20 @@ class AssignmentRepository extends ServiceEntityRepository
->select('assignment', 'destination', 'job_profile', 'application', 'disposition')
->innerJoin('assignment.destination', 'destination')
->innerJoin('assignment.jobProfile', 'job_profile')
->where($qb->expr()->isNull('assignment.deletedAt'))
->where($qb->expr()->andX(
$qb->expr()->orX(
$qb->expr()->gt('destination.dateFrom', ':now'),
$qb->expr()->andX(
$qb->expr()->isNotNull('assignment.dateFrom'),
$qb->expr()->gt('assignment.dateFrom', ':now')
)
),
$qb->expr()->isNull('assignment.deletedAt')
))
->leftJoin('assignment.applications', 'application', Join::WITH, $qb->expr()->eq('application.teamer', ':teamer'))
->leftJoin('assignment.dispositions', 'disposition', Join::WITH, $qb->expr()->eq('disposition.teamer', ':teamer'))
->setParameter('teamer', $teamer)
->setParameter('now', new \DateTimeImmutable())
;
$this->applyFilterSettings($filterDto, $qb);