diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 2b06b51d..178f4584 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -3978,7 +3978,12 @@ export class ProfileController extends Controller { // await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน const profile = await this.profileRepo.findOne({ where: { id: id }, - relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"], + relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot", "profileSalary"], + order: { + profileSalary: { + order: "DESC", + } + } }); if (!profile) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); @@ -4155,6 +4160,7 @@ export class ProfileController extends Controller { posNo: shortName, isPosmasterAct: data.length > 0, posmasterAct: data, + salary: profile && profile.profileSalary.length > 0 ? profile.profileSalary[0].amount : null, }; if (_profile.child4Id != null) { diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index f4222790..e3c8ed77 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -3705,7 +3705,12 @@ export class ProfileEmployeeController extends Controller { async getProfileByProfileid(@Request() request: RequestWithUser, @Path() id: string) { const profile = await this.profileRepo.findOne({ where: { id: id }, - relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"], + relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot", "profileSalarys"], + order: { + profileSalarys: { + order: "DESC" + } + } }); if (!profile) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); @@ -3826,6 +3831,7 @@ export class ProfileEmployeeController extends Controller { node: null, nodeId: null, posNo: shortName, + salary: profile && profile.profileSalarys.length > 0 ? profile.profileSalarys[0].amount : null }; if (_profile.child4Id != null) {