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
+9 -3
View File
@@ -155,8 +155,9 @@ class DispositionRepository extends ServiceEntityRepository
$qb = $this->createQueryBuilder('disposition');
return $qb
->select('disposition', 'assignment', 'destination')
->select('disposition', 'assignment', 'job_profile', 'destination')
->innerJoin('disposition.assignment', 'assignment')
->innerJoin('assignment.jobProfile', 'job_profile')
->innerJoin('assignment.destination', 'destination')
->where($qb->expr()->andX(
$qb->expr()->orX(
@@ -182,9 +183,11 @@ class DispositionRepository extends ServiceEntityRepository
$qb = $this->createQueryBuilder('disposition');
$qb
->select('disposition', 'assignment', 'destination', 'feedback', 'teamer')
->select('disposition', 'assignment', 'job_profile', 'destination', 'feedback', 'teamer', 'user')
->innerJoin('disposition.assignment', 'assignment')
->innerJoin('assignment.jobProfile', 'job_profile')
->innerJoin('disposition.teamer', 'teamer')
->innerJoin('teamer.user', 'user')
->innerJoin('assignment.destination', 'destination')
->leftJoin('disposition.feedback', 'feedback')
->where($qb->expr()->andX(
@@ -292,10 +295,13 @@ class DispositionRepository extends ServiceEntityRepository
$qb = $this->createQueryBuilder('disposition');
return $qb
->select('disposition', 'assignment', 'destination', 'document')
->select('disposition', 'assignment', 'job_profile', 'destination', 'document', 'teamer', 'user')
->innerJoin('disposition.assignment', 'assignment')
->innerJoin('assignment.jobProfile', 'job_profile')
->innerJoin('assignment.destination', 'destination')
->leftJoin('disposition.documents', 'document')
->innerJoin('disposition.teamer', 'teamer')
->innerJoin('teamer.user', 'user')
->where($qb->expr()->andX(
$qb->expr()->lte('disposition.createdAt', ':dueDate'),
$qb->expr()->eq('disposition.status', ':status'),