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