fix issue #1357 ข้อมูลอายุราชการไม่แสดง

This commit is contained in:
Bright 2025-04-03 17:41:47 +07:00
parent 3ce2f932d6
commit 5837ca1724

View file

@ -47,17 +47,17 @@ export async function calculateGovAge(profileId: string, type: string) {
// type = OFFICER , EMPLOYEE
const isEmployee = type === "EMPLOYEE";
const records = await AppDataSource.getRepository(ProfileSalary).find({
where: {
[isEmployee ? "profileEmployeeId" : "profileId"]: profileId,
},
select: ["commandDateAffect", "dateGovernment", "isGovernment"],
order: { order: "ASC" },
});
// const records = await AppDataSource.getRepository(ProfileSalary).find({
// where: {
// [isEmployee ? "profileEmployeeId" : "profileId"]: profileId,
// },
// select: ["commandDateAffect", "dateGovernment", "isGovernment"],
// order: { order: "ASC" },
// });
if (!records || records.length === 0) {
return null;
}
// if (!records || records.length === 0) {
// return null;
// }
let endDateFristRec: any = null;
endDateFristRec = await AppDataSource.getRepository(ProfileSalary).findOne({