Browse Source

假勤日统计

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

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

@ -192,6 +192,27 @@ async function del (ctx) {
}
}
async function nativePlaceList (ctx) {
// 获取已有的户籍地列表
try {
const { models } = ctx.fs.dc;
const nRes = await models.Member.findAll({
attributes: [''],
group: ''
})
ctx.status = 200;
ctx.body = []
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function list (ctx) {
try {
const { models } = ctx.fs.dc;
@ -337,12 +358,15 @@ async function overTimeStatistics (ctx) {
`).toPromise()
const statisticDayRes = await clickHouse.hr.query(`
SELECT overtime_day.day, sum(overtime_day.duration) AS duration
SELECT
overtime_day.day,
sum(overtime_day.duration) AS duration,
overtime.compensate AS compensate
FROM overtime_day
INNER JOIN overtime
ON overtime.id = overtime_day.overtime_id
AND overtime.pep_user_id = ${pepUserId}
GROUP BY overtime_day.day
GROUP BY overtime_day.day, overtime.compensate
`).toPromise()
let returnD = {

Loading…
Cancel
Save