mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixed: [similar person matcher] properly takes person center into account
Center comes from the table person_center_history, not person.center_id
This commit is contained in:
parent
ecac409586
commit
a8977729fe
@ -76,8 +76,17 @@ class SimilarPersonMatcher
|
||||
|
||||
$qb->select('p')
|
||||
->from(Person::class, 'p')
|
||||
->join('p.centerHistory', 'center_history')
|
||||
->where('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName))) >= :precision')
|
||||
->andWhere($qb->expr()->in('p.center', ':centers'));
|
||||
->andWhere($qb->expr()->in('center_history.center', ':centers'))
|
||||
->andWhere($qb->expr()->andX(
|
||||
$qb->expr()->lte('center_history.startDate', 'CURRENT_DATE()'),
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->isNull('center_history.endDate'),
|
||||
$qb->expr()->gt('center_history.endDate', 'CURRENT_DATE()')
|
||||
)
|
||||
))
|
||||
;
|
||||
|
||||
$qb
|
||||
->setParameter('fullName', $this->personRender->renderString($person, []))
|
||||
|
Loading…
x
Reference in New Issue
Block a user