Browse Source

fix 档案和信息加班时间不一

master
巴林闲侠 2 years ago
parent
commit
bfe5cc3ab2
  1. 6
      api/app/lib/controllers/member/index.js

6
api/app/lib/controllers/member/index.js

@ -309,8 +309,8 @@ async function overTimeStatistics (ctx) {
const timeOption = [] const timeOption = []
if (startDate && endDate) { if (startDate && endDate) {
timeOption.push( 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')}'
AND wpStory.create_at >= '${moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss')}'` AND start_time >= '${moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss')}'`
) )
} }
const dataRes = await clickHouse.hr.query(` const dataRes = await clickHouse.hr.query(`
@ -332,8 +332,8 @@ async function overTimeStatistics (ctx) {
overtime overtime
INNER JOIN ${pepEmis}.workflow_process_history AS wpStory INNER JOIN ${pepEmis}.workflow_process_history AS wpStory
ON wpStory.id = overtime.pep_process_story_id ON wpStory.id = overtime.pep_process_story_id
${timeOption.length ? `AND ${timeOption.join(' AND ')}` : ''}
WHERE overtime.pep_user_id = ${pepUserId} WHERE overtime.pep_user_id = ${pepUserId}
${timeOption.length ? `AND ${timeOption.join(' AND ')}` : ''}
`).toPromise() `).toPromise()
const statisticRes = await clickHouse.hr.query(` const statisticRes = await clickHouse.hr.query(`

Loading…
Cancel
Save