fix: don't show past assignments in teamers' overview
This commit is contained in:
@@ -55,10 +55,20 @@ class AssignmentRepository extends ServiceEntityRepository
|
|||||||
->select('assignment', 'destination', 'job_profile', 'application', 'disposition')
|
->select('assignment', 'destination', 'job_profile', 'application', 'disposition')
|
||||||
->innerJoin('assignment.destination', 'destination')
|
->innerJoin('assignment.destination', 'destination')
|
||||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
->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.applications', 'application', Join::WITH, $qb->expr()->eq('application.teamer', ':teamer'))
|
||||||
->leftJoin('assignment.dispositions', 'disposition', Join::WITH, $qb->expr()->eq('disposition.teamer', ':teamer'))
|
->leftJoin('assignment.dispositions', 'disposition', Join::WITH, $qb->expr()->eq('disposition.teamer', ':teamer'))
|
||||||
->setParameter('teamer', $teamer)
|
->setParameter('teamer', $teamer)
|
||||||
|
->setParameter('now', new \DateTimeImmutable())
|
||||||
;
|
;
|
||||||
|
|
||||||
$this->applyFilterSettings($filterDto, $qb);
|
$this->applyFilterSettings($filterDto, $qb);
|
||||||
|
|||||||
Reference in New Issue
Block a user