From b3dae5a6d725db5a34fc5da46eed968e91810c03 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 22 Oct 2024 16:45:23 +0700 Subject: [PATCH] no message --- src/controllers/ProfileController.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 3a9e797a..ab0219d3 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -4225,7 +4225,18 @@ export class ProfileController extends Controller { async getProfileByCitizenId(@Request() request: RequestWithUser, @Path() id: string) { const profile = await this.profileRepo.findOne({ where: { citizenId: 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, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); @@ -4311,6 +4322,15 @@ export class ProfileController extends Controller { child4ShortName: child4 == null ? null : child4.orgChild4ShortName, node: null, nodeId: null, + amount: profile && profile.profileSalary.length > 0 ? profile.profileSalary[0].amount : null, + positionSalaryAmount: + profile && profile.profileSalary.length > 0 + ? profile.profileSalary[0].positionSalaryAmount + : null, + mouthSalaryAmount: + profile && profile.profileSalary.length > 0 + ? profile.profileSalary[0].mouthSalaryAmount + : null, }; if (_profile.child4Id != null) {