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