Merge branch '267-Fix-the-join-with-the-user-list' into 'master'

Fix the join in the user list (admin): show only current user job

Closes #267

See merge request Chill-Projet/chill-bundles!669
This commit is contained in:
Julien Fastré 2024-03-20 12:34:13 +00:00
commit 9ff7aef3fc
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,6 @@
kind: Fixed
body: 'Fix the join between job and user in the user list (admin): show only the current
user job'
time: 2024-03-20T12:35:27.885282599+01:00
custom:
Issue: "267"

View File

@ -106,8 +106,8 @@ final readonly class UserRepository implements UserRepositoryInterface
FROM users u
LEFT JOIN chill_main_civility civility ON u.civility_id = civility.id
LEFT JOIN centers mainCenter ON u.maincenter_id = mainCenter.id
LEFT JOIN chill_main_user_job_history userJobHistory ON u.id = userJobHistory.user_id
LEFT JOIN chill_main_user_job userJob ON userJobHistory.job_id = userJob.id AND tstzrange(userJobHistory.startdate, userJobHistory.enddate) @> NOW()
LEFT JOIN chill_main_user_job_history userJobHistory ON u.id = userJobHistory.user_id AND tstzrange(userJobHistory.startdate, userJobHistory.enddate) @> NOW()
LEFT JOIN chill_main_user_job userJob ON userJobHistory.job_id = userJob.id
LEFT JOIN chill_main_user_scope_history userScopeHistory ON u.id = userScopeHistory.user_id AND tstzrange(userScopeHistory.startdate, userScopeHistory.enddate) @> NOW()
LEFT JOIN scopes mainScope ON userScopeHistory.scope_id = mainScope.id
LEFT JOIN chill_main_location currentLocation ON u.currentlocation_id = currentLocation.id