From 7bb5b19398207ab19cc5568a8c4b181ca2165e23 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Thu, 6 Feb 2020 09:33:36 +0100 Subject: [PATCH] refactor table holidayType and holidayDetail --- modules/worker/back/methods/holiday/getByWarehouse.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/worker/back/methods/holiday/getByWarehouse.js b/modules/worker/back/methods/holiday/getByWarehouse.js index a56b5166e..8a7fd8be3 100644 --- a/modules/worker/back/methods/holiday/getByWarehouse.js +++ b/modules/worker/back/methods/holiday/getByWarehouse.js @@ -23,11 +23,11 @@ module.exports = Self => { beginningYear.setHours(0, 0, 0, 0); let holidays = await Self.rawSql( - `SELECT lh.dated, lhl.description, lht.name, w.id + `SELECT lh.dated, chn.name, cht.name, w.id FROM vn.holiday lh JOIN vn.workCenter w ON w.id = lh.workcenterFk - LEFT JOIN vn.holidayDetail lhl ON lhl.id = lh.holidayDetailFk - LEFT JOIN vn.holidayType lht ON lht.id = lh.holidayTypeFk + LEFT JOIN vn.calendarHolidaysName chn ON chn.id = lh.holidayDetailFk + LEFT JOIN vn.calendarHolidaysType cht ON cht.id = lh.holidayTypeFk WHERE w.warehouseFk = ? AND lh.dated >= ?`, [warehouseFk, beginningYear]); return holidays.map(holiday => {