feat: extend teamer dashboard
This commit is contained in:
@@ -29,8 +29,9 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
|
||||
return $qb
|
||||
->select('disposition', 'assignment', 'job_profile', 'destination')
|
||||
->select('disposition', 'assignment', 'job_profile', 'destination', 'documents')
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->leftJoin('assignment.documents', 'documents')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->where($qb->expr()->andX(
|
||||
@@ -52,6 +53,15 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
public function getUpcomingDispositionsByTeamer(Teamer $teamer, int $limit = 5): array
|
||||
{
|
||||
return $this
|
||||
->getUpcomingDispositionsByTeamerQuery($teamer)
|
||||
->setMaxResults($limit)
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function getRecentDispositionsByTeamerQuery(Teamer $teamer): Query
|
||||
{
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
@@ -123,10 +133,12 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->in('destination.hotelBusProId', ':hotelBusProIds'),
|
||||
$qb->expr()->lt('destination.dateTo', ':dateTo')
|
||||
$qb->expr()->lt('destination.dateTo', ':dateTo'),
|
||||
$qb->expr()->eq('disposition.status', ':status')
|
||||
))
|
||||
->setParameter('hotelBusProIds', $hotelBusProIds)
|
||||
->setParameter('dateTo', new \DateTimeImmutable())
|
||||
->setParameter('status', Disposition::STATUS_NEW)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user