From 0459671606792754bc7acb0086e76cd68658b401 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Fri, 21 Oct 2022 12:30:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=A1=A3=E6=A1=88=E5=92=8C=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=AF=B7=E5=81=87=E6=97=B6=E9=97=B4=E4=B8=8D=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/.vscode/launch.json | 12 +++++------- api/app/lib/controllers/member/index.js | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index 072fba5..8f28ea6 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -27,26 +27,24 @@ "--qnbkt dev-hr", // "--qndmn http://resources.anxinyun.cn", "--qndmn http://rjkwed13l.hn-bkt.clouddn.com", - // click 开发 - "--clickHouseUrl http://10.8.30.71", - // click 测试 - // "--clickHouseUrl http://10.8.30.161", - // "--clickHouseUrl https://clickhouse01.anxinyun.cn/play", - "--clickHousePort 30123", // 似乎不能传空 先注释 * 2 // "--clickHouseUser ", // "--clickHousePassword ", + "--clickHousePort 30123", + // 开发 + "--clickHouseUrl http://10.8.30.71", "--clickHousePepEmis pepca_dev", "--clickHouseCamworkflow camworkflow", "--clickHouseHr hr_dev", // 测试 + // "--clickHouseUrl http://10.8.30.161", // "--clickHousePepEmis pepca8", // "--clickHouseCamworkflow camworkflow", - // "--clickHouseHr hr_dev", + // "--clickHouseHr hrm", ] }, { diff --git a/api/app/lib/controllers/member/index.js b/api/app/lib/controllers/member/index.js index c2c5867..7f5f435 100644 --- a/api/app/lib/controllers/member/index.js +++ b/api/app/lib/controllers/member/index.js @@ -397,13 +397,23 @@ async function vacateStatistics (ctx) { const timeOption = [] if (startDate) { + // 按发起时间 + // timeOption.push( + // `wpStory.create_at >= '${moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss')}'` + // ) + + // 按请假开始时间 timeOption.push( - `wpStory.create_at > '${moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss')}'` + `start_time >= '${moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss')}'` ) } if (endDate) { + // timeOption.push( + // `wpStory.create_at <= '${moment(endDate).endOf('day').format('YYYY-MM-DD HH:mm:ss')}'` + // ) + timeOption.push( - `wpStory.create_at <= '${moment(endDate).endOf('day').format('YYYY-MM-DD HH:mm:ss')}'` + `start_time <= '${moment(endDate).endOf('day').format('YYYY-MM-DD HH:mm:ss')}'` ) } const dataRes = await clickHouse.hr.query(` @@ -419,8 +429,8 @@ async function vacateStatistics (ctx) { vacate INNER JOIN ${pepEmis}.workflow_process_history AS wpStory ON wpStory.id = vacate.pep_process_story_id - ${timeOption.length ? `AND ${timeOption.join(' AND ')}` : ''} WHERE vacate.pep_user_id = ${pepUserId} + ${timeOption.length ? `AND ${timeOption.join(' AND ')}` : ''} `).toPromise() const statisticRes = await clickHouse.hr.query(`