From e8094726f0d6f3324939ee49ea950e3cc934ae17 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 18 Apr 2024 14:28:26 +0700 Subject: [PATCH] =?UTF-8?q?filter=20=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=AB=E0=B8=99=E0=B9=88=E0=B8=A7?= =?UTF-8?q?=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/DevelopmentEmployeeHistoryController.ts | 7 ++++++- src/controllers/DevelopmentHistoryController.ts | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/controllers/DevelopmentEmployeeHistoryController.ts b/src/controllers/DevelopmentEmployeeHistoryController.ts index 5af4ebf..6d6dadc 100644 --- a/src/controllers/DevelopmentEmployeeHistoryController.ts +++ b/src/controllers/DevelopmentEmployeeHistoryController.ts @@ -238,7 +238,12 @@ export class DevelopmentEmployeeHistoryController extends Controller { : "1=1", { year: body.year }, ) - .andWhere(body.root != null ? "developmentHistory.root = :root" : "1=1", { root: body.root }) + .andWhere( + body.root != null && body.root != undefined ? "developmentHistory.rootId = :root" : "1=1", + { + root: body.root, + }, + ) .andWhere("developmentHistory.type = :type", { type: type }) .andWhere( new Brackets((qb) => { diff --git a/src/controllers/DevelopmentHistoryController.ts b/src/controllers/DevelopmentHistoryController.ts index 8ba2d90..cee2aee 100644 --- a/src/controllers/DevelopmentHistoryController.ts +++ b/src/controllers/DevelopmentHistoryController.ts @@ -230,9 +230,12 @@ export class DevelopmentOfficerHistoryController extends Controller { : "1=1", { year: body.year }, ) - .andWhere(body.root != null && body.root != undefined ? "development.root = :root" : "1=1", { - root: body.root, - }) + .andWhere( + body.root != null && body.root != undefined ? "development.rootId = :root" : "1=1", + { + root: body.root, + }, + ) .andWhere(body.root != null ? "developmentHistory.root = :root" : "1=1", { root: body.root }) .andWhere("developmentHistory.type = :type", { type: type }) .andWhere(