filter by firstName & lastName
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-03-29 13:07:06 +01:00
parent 7e2f07aa83
commit 75cb05865b
1 changed files with 3 additions and 2 deletions

View File

@ -39,7 +39,8 @@ module.exports = Self => {
case 'firstName':
return {or: [
{'w.firstName': {like: `%${value}%`}},
{'w.name': {like: `%${value}%`}},
{'w.lastName': {like: `%${value}%`}},
{'u.name': {like: `%${value}%`}},
{'u.nickname': {like: `%${value}%`}}
]};
case 'id':
@ -54,7 +55,7 @@ module.exports = Self => {
myFilter = mergeFilters(myFilter, clientFilter);
let stmt = new ParameterizedSQL(
`SELECT DISTINCT w.id, w.firstName, w.name, u.nickname
`SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname
FROM worker w
JOIN account.user u ON u.id = w.userFk
JOIN account.roleRole i ON i.role = u.role