feat: overdue feedbacks on admin dashboard
This commit is contained in:
@@ -170,7 +170,7 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
public function getDispositionsWithPendingFeedbackQuery(?string $hotelCode = null): Query
|
||||
public function getDispositionsWithPendingFeedbackQuery(?string $hotelCode = null, ?int $offsetDays = null): Query
|
||||
{
|
||||
$qb = $this->createQueryBuilder('disposition');
|
||||
|
||||
@@ -191,9 +191,14 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
$qb->expr()->isNull('feedback')
|
||||
))
|
||||
->setParameter('status', [Assignment::STATUS_CALLED_OFF, Assignment::STATUS_DELETED])
|
||||
->setParameter('dateTo', new \DateTimeImmutable())
|
||||
;
|
||||
|
||||
$dateTo = new \DateTimeImmutable();
|
||||
if (null !== $offsetDays) {
|
||||
$dateTo = $dateTo->modify('-'.$offsetDays.' days');
|
||||
}
|
||||
$qb->setParameter('dateTo', $dateTo);
|
||||
|
||||
if (null !== $hotelCode) {
|
||||
$qb
|
||||
->andWhere($qb->expr()->like('destination.hotelCode', ':hotelCode'))
|
||||
@@ -204,10 +209,10 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
return $qb->getQuery();
|
||||
}
|
||||
|
||||
public function findDispositionsWithPendingFeedback(): array
|
||||
public function findDispositionsWithOverdueFeedback(?int $offsetDays = null): array
|
||||
{
|
||||
return $this
|
||||
->getDispositionsWithPendingFeedbackQuery()
|
||||
->getDispositionsWithPendingFeedbackQuery(null, $offsetDays)
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user