From c0e2c10cee1f744e888a29066b386004011f9926 Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 31 Jul 2025 10:37:01 +0700 Subject: [PATCH] =?UTF-8?q?FIX=20=E0=B8=AA=E0=B9=88=E0=B8=87=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=A5?= =?UTF-8?q?=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=8A?= =?UTF-8?q?=E0=B8=B1=E0=B9=88=E0=B8=A7=E0=B8=84=E0=B8=A3=E0=B8=B2=E0=B8=A7?= =?UTF-8?q?=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88?= =?UTF-8?q?=E0=B8=87=E0=B9=83=E0=B8=99=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87?= =?UTF-8?q?=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=A5=E0=B8=B9?= =?UTF-8?q?=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=88=E0=B8=B3=E0=B9=84=E0=B8=9B=E0=B8=AD=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileEmployeeTempController.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/controllers/ProfileEmployeeTempController.ts b/src/controllers/ProfileEmployeeTempController.ts index 557d727d..2318da33 100644 --- a/src/controllers/ProfileEmployeeTempController.ts +++ b/src/controllers/ProfileEmployeeTempController.ts @@ -1132,6 +1132,19 @@ export class ProfileEmployeeTempController extends Controller { child4: _dataOrg.child4, }, ) + // หรือ ไม่ได้เลือกตำแหน่งในโครงสร้างลูกจ้างชั่วคราว แต่เลือกตำแหน่งในโครงสร้างลูกจ้างประจำแล้ว + .orWhere( + `current_holderTemps.orgRootId is null AND + profileEmployee.rootIdTemp is not null AND + profileEmployee.statusTemp = :statusTemp AND + profileEmployee.employeeClass = :type AND + profileEmployee.createdUserId = :keycloak`, + { + statusTemp: "PENDING", + type: "TEMP", + keycloak: request.user.sub + } + ) .getManyAndCount(); const data = await Promise.all( record.map((_data) => {