search probation

This commit is contained in:
kittapath 2024-12-25 01:10:49 +07:00
parent 4cb2887784
commit 51c6d8f615
3 changed files with 99 additions and 96 deletions

View file

@ -4622,7 +4622,7 @@ export class ProfileController extends Controller {
citizenId: profile.citizenId,
posNo: shortNames[index],
positionName: positionName,
date: holder.createdAt
date: holder.createdAt,
};
});
})
@ -6728,15 +6728,18 @@ export class ProfileController extends Controller {
)
.andWhere(
new Brackets((qb) => {
qb.orWhere(`profile.prefix LIKE :keyword and profile.isProbation = ${isProbation}`, {
keyword: `%${body.keyword}%`,
})
.orWhere(`profile.firstName LIKE :keyword and profile.isProbation = ${isProbation}`, {
qb.orWhere(
`CONCAT(profile.prefix, profile.firstName, ' ', profile.lastName) LIKE :keyword and profile.isProbation = ${isProbation}`,
{
keyword: `%${body.keyword}%`,
})
.orWhere(`profile.lastName LIKE :keyword and profile.isProbation = ${isProbation}`, {
keyword: `%${body.keyword}%`,
})
},
)
// .orWhere(`profile.firstName LIKE :keyword and profile.isProbation = ${isProbation}`, {
// keyword: `%${body.keyword}%`,
// })
// .orWhere(`profile.lastName LIKE :keyword and profile.isProbation = ${isProbation}`, {
// keyword: `%${body.keyword}%`,
// })
.orWhere(`profile.position LIKE :keyword and profile.isProbation = ${isProbation}`, {
keyword: `%${body.keyword}%`,
})