WIP: Implement admin dashboard

This commit is contained in:
Björn Fromme
2023-10-22 17:05:43 +02:00
parent 38d6fafcb2
commit 91f0f76ccc
15 changed files with 280 additions and 4 deletions
+32
View File
@@ -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()
;
}
}