This commit is contained in:
张成
2025-12-26 14:22:33 +08:00
parent 1d8d2ea6e8
commit 54644dbb72
6 changed files with 103 additions and 93 deletions

View File

@@ -203,7 +203,8 @@ module.exports = {
interviewCount,
todayCount,
weekCount,
monthCount
monthCount,
totalJobCount
] = await Promise.all([
// 总计(如果提供了时间范围,则只统计该范围内的)
apply_records.count({ where: baseWhere }),
@@ -211,6 +212,7 @@ module.exports = {
apply_records.count({ where: { ...baseWhere, applyStatus: 'failed' } }),
apply_records.count({ where: { ...baseWhere, applyStatus: 'pending' } }),
apply_records.count({ where: { ...baseWhere, feedbackStatus: 'interview' } }),
// 今日如果提供了时间范围则返回0否则统计今日
startTime || endTime ? 0 : apply_records.count({
where: {
@@ -231,7 +233,14 @@ module.exports = {
sn_code: final_sn_code,
create_time: { [op.gte]: monthStart }
}
})
}),
// 总职位数
job_postings.count({
where: {
sn_code: final_sn_code,
create_time: { [op.gte]: todayStart }
}
}),
]);
return ctx.success({
@@ -243,6 +252,7 @@ module.exports = {
todayCount,
weekCount,
monthCount,
totalJobCount,
successRate: totalCount > 0 ? ((successCount / totalCount) * 100).toFixed(2) : 0,
interviewRate: totalCount > 0 ? ((interviewCount / totalCount) * 100).toFixed(2) : 0
});