|
|
@ -11,25 +11,25 @@ const moment = require('moment') |
|
|
|
async function getemployeeAssessmentList(ctx) { |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc; |
|
|
|
const { limit, page, year,month } = ctx.query; |
|
|
|
const { limit, page, year, month } = ctx.query; |
|
|
|
const { type } = ctx.params; |
|
|
|
let rlst = []; |
|
|
|
const findObj = { |
|
|
|
order: [["year", "desc"],["month", "desc"]], |
|
|
|
where:{} |
|
|
|
}; |
|
|
|
if (Number(limit) > 0 && Number(page) >= 0) { |
|
|
|
findObj.limit = Number(limit); |
|
|
|
findObj.offset = Number(page) * Number(limit); |
|
|
|
} |
|
|
|
if (year && month) { |
|
|
|
findObj.where.year = year; |
|
|
|
findObj.where.month = month; |
|
|
|
} |
|
|
|
if (type) { |
|
|
|
findObj.where.type = type; |
|
|
|
} |
|
|
|
rlst = await models.PerformanceAll.findAndCountAll(findObj); |
|
|
|
const findObj = { |
|
|
|
order: [["year", "desc"], ["month", "desc"]], |
|
|
|
where: {} |
|
|
|
}; |
|
|
|
if (Number(limit) > 0 && Number(page) >= 0) { |
|
|
|
findObj.limit = Number(limit); |
|
|
|
findObj.offset = Number(page) * Number(limit); |
|
|
|
} |
|
|
|
if (year && month) { |
|
|
|
findObj.where.year = year; |
|
|
|
findObj.where.month = month; |
|
|
|
} |
|
|
|
if (type) { |
|
|
|
findObj.where.type = type; |
|
|
|
} |
|
|
|
rlst = await models.PerformanceAll.findAndCountAll(findObj); |
|
|
|
ctx.status = 200; |
|
|
|
ctx.body = rlst; |
|
|
|
} catch (err) { |
|
|
|