fix: improve some database queries

This commit is contained in:
Björn Fromme
2025-03-19 09:13:02 +01:00
parent 374e01cf1d
commit 9aaf996e07
6 changed files with 34 additions and 12 deletions
+4 -2
View File
@@ -31,11 +31,12 @@ class ApplicationRepository extends ServiceEntityRepository
$qb = $this->createQueryBuilder('application');
$qb
->select('application', 'assignment', 'destination', 'job_profile', 'teamer')
->select('application', 'assignment', 'job_profile', 'destination', 'teamer', 'user')
->innerJoin('application.assignment', 'assignment')
->innerJoin('assignment.destination', 'destination')
->innerJoin('assignment.jobProfile', 'job_profile')
->innerJoin('application.teamer', 'teamer')
->innerJoin('teamer.user', 'user')
->where($qb->expr()->neq('application.status', ':status'))
->setParameter('status', Application::STATUS_REJECTED)
;
@@ -159,11 +160,12 @@ class ApplicationRepository extends ServiceEntityRepository
$qb = $this->createQueryBuilder('application');
return $qb
->select('application', 'assignment', 'destination', 'job_profile', 'teamer')
->select('application', 'assignment', 'destination', 'job_profile', 'teamer', 'user')
->innerJoin('application.assignment', 'assignment')
->innerJoin('assignment.destination', 'destination')
->innerJoin('assignment.jobProfile', 'job_profile')
->innerJoin('application.teamer', 'teamer')
->innerJoin('teamer.user', 'user')
->where($qb->expr()->neq('application.status', ':status'))
->orderBy('application.createdAt', 'DESC')
->setParameter('status', Application::STATUS_REJECTED)