Merge branch '155-fix-regulation-list-postal-code-search' into 'master'

Feature: in regulation list, search by postal code instead of postal code's string content

Closes #155

See merge request Chill-Projet/chill-bundles!594
This commit is contained in:
2023-09-26 16:03:30 +00:00
2 changed files with 9 additions and 3 deletions

View File

@@ -79,11 +79,10 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin
Join::WITH,
'COALESCE(IDENTITY(person_address.address), IDENTITY(location_history.addressLocation)) = address.id'
)
->join('address.postcode', 'postcode')
->andWhere(
$qb->expr()->in('postcode.code', ':postal_codes')
$qb->expr()->in('address.postcode', ':postal_codes')
)
->setParameter('postal_codes', array_map(fn (PostalCode $postalCode) => $postalCode->getCode(), $postalCodes));
->setParameter('postal_codes', $postalCodes);
}
return $qb;