fix: correctly filter by multiple hotels
This commit is contained in:
@@ -127,11 +127,15 @@ class AssignmentRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($filterDto->getHotels() as $hotel) {
|
if (0 < count($filterDto->getHotels())) {
|
||||||
$qb
|
$constraints = [];
|
||||||
->andWhere($qb->expr()->like('destination.hotel', ':hotel'))
|
foreach ($filterDto->getHotels() as $index => $hotel) {
|
||||||
->setParameter('hotel', '%'.$hotel.'%')
|
$constraints[] = $qb->expr()->like('destination.hotel', ':hotel'.$index);
|
||||||
;
|
}
|
||||||
|
$qb->andWhere($qb->expr()->orX(...$constraints));
|
||||||
|
foreach ($filterDto->getHotels() as $index => $hotel) {
|
||||||
|
$qb->setParameter('hotel'.$index, '%'.$hotel.'%');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $duration = $filterDto->getDuration()) {
|
if (null !== $duration = $filterDto->getDuration()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user