WIP: Implement admin dashboard
This commit is contained in:
@@ -72,4 +72,36 @@ class ApplicationRepository extends ServiceEntityRepository
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function getNew(int $limit = 5): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('application');
|
||||
|
||||
return $qb
|
||||
->select('application', 'assignment', 'destination', 'job_profile', 'teamer')
|
||||
->innerJoin('application.assignment', 'assignment')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('application.teamer', 'teamer')
|
||||
->where($qb->expr()->neq('application.status', ':status'))
|
||||
->orderBy('application.createdAt', 'DESC')
|
||||
->setParameter('status', Application::STATUS_REJECTED)
|
||||
->setMaxResults($limit)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function getCountByStatus(string $status): ?int
|
||||
{
|
||||
$qb = $this->createQueryBuilder('application');
|
||||
|
||||
return $qb
|
||||
->select($qb->expr()->count('application'))
|
||||
->where($qb->expr()->eq('application.status', ':status'))
|
||||
->setParameter('status', $status)
|
||||
->getQuery()
|
||||
->getSingleScalarResult()
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user