fix: ignore status when fetching pending feedbacks
This commit is contained in:
@@ -177,10 +177,16 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->leftJoin('disposition.feedback', 'feedback')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('disposition.status', ':status'),
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->isNotNull('assignment.dateTo'),
|
||||
$qb->expr()->lte('assignment.dateTo', ':dateTo')
|
||||
),
|
||||
$qb->expr()->lte('destination.dateTo', ':dateTo')
|
||||
),
|
||||
$qb->expr()->isNull('feedback')
|
||||
))
|
||||
->setParameter('status', Disposition::STATUS_COMPLETED)
|
||||
->setParameter('dateTo', new \DateTimeImmutable())
|
||||
;
|
||||
|
||||
if (null !== $hotelBusProIds) {
|
||||
@@ -219,20 +225,14 @@ class DispositionRepository extends ServiceEntityRepository
|
||||
return $qb
|
||||
->innerJoin('disposition.assignment', 'assignment')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->neq('disposition.status', ':status'),
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->isNotNull('assignment.dateTo'),
|
||||
$qb->expr()->lte('assignment.dateTo', ':dateTo')
|
||||
),
|
||||
$qb->expr()->lte('destination.dateTo', ':dateTo')
|
||||
)
|
||||
->where($qb->expr()->orX(
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->isNotNull('assignment.dateTo'),
|
||||
$qb->expr()->lte('assignment.dateTo', ':dateTo')
|
||||
),
|
||||
$qb->expr()->lte('destination.dateTo', ':dateTo')
|
||||
))
|
||||
->setParameters([
|
||||
'status' => Disposition::STATUS_COMPLETED,
|
||||
'dateTo' => new \DateTimeImmutable(),
|
||||
])
|
||||
->setParameter('dateTo', new \DateTimeImmutable())
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user