fix ค้นหาข้อมูลทะเบียนประวัติลูกจ้าง

This commit is contained in:
Bright 2025-01-31 10:54:25 +07:00
parent cf5b36b94c
commit 87a91b035c

View file

@ -1616,16 +1616,16 @@ export class ProfileEmployeeController extends Controller {
)
.andWhere(
isProbation != undefined && isProbation != null
? `profile.isProbation = ${isProbation}`
? `profileEmployee.isProbation = ${isProbation}`
: "1=1",
)
.andWhere(
isRetire != undefined && isRetire != null
? isRetire == false
? `profile.dateLeave IS NULL`
? `profileEmployee.dateLeave IS NULL`
: isRetire == true && retireType != undefined && retireType != null
? `profile.dateLeave IS NOT NULL AND profile.leaveType = '${retireType}'`
: `profile.dateLeave IS NOT NULL`
? `profileEmployee.dateLeave IS NOT NULL AND profileEmployee.leaveType = '${retireType}'`
: `profileEmployee.dateLeave IS NOT NULL`
: "1=1"
)
.andWhere("profileEmployee.employeeClass LIKE :type", {