From 77789446f33add270ccc2b3a35941e1fba9b2e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=88=90?= Date: Fri, 26 Dec 2025 13:30:20 +0800 Subject: [PATCH] 1 --- api/controller_front/apply.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/api/controller_front/apply.js b/api/controller_front/apply.js index 204a0dc..2f71659 100644 --- a/api/controller_front/apply.js +++ b/api/controller_front/apply.js @@ -73,14 +73,14 @@ module.exports = { // 时间范围筛选 if (seachOption.startTime || seachOption.endTime) { - where.applyTime = {}; + where.create_time = {}; if (seachOption.startTime) { - where.applyTime[op.gte] = new Date(seachOption.startTime); + where.create_time[op.gte] = new Date(seachOption.startTime); } if (seachOption.endTime) { const endTime = new Date(seachOption.endTime); endTime.setHours(23, 59, 59, 999); // 设置为当天的最后一刻 - where.applyTime[op.lte] = endTime; + where.create_time[op.lte] = endTime; } } @@ -106,7 +106,7 @@ module.exports = { where, limit, offset, - order: [['applyTime', 'DESC']] + order: [['create_time', 'DESC']] }); return ctx.success({ @@ -162,14 +162,14 @@ module.exports = { // 如果提供了时间范围,则添加到查询条件中 if (startTime || endTime) { - baseWhere.applyTime = {}; + baseWhere.create_time = {}; if (startTime) { - baseWhere.applyTime[op.gte] = new Date(startTime); + baseWhere.create_time[op.gte] = new Date(startTime); } if (endTime) { const endTimeDate = new Date(endTime); endTimeDate.setHours(23, 59, 59, 999); // 设置为当天的最后一刻 - baseWhere.applyTime[op.lte] = endTimeDate; + baseWhere.create_time[op.lte] = endTimeDate; } } @@ -221,21 +221,21 @@ module.exports = { startTime || endTime ? 0 : apply_records.count({ where: { sn_code: final_sn_code, - applyTime: { [op.gte]: todayStart } + create_time: { [op.gte]: todayStart } } }), // 本周(如果提供了时间范围,则返回0,否则统计本周) startTime || endTime ? 0 : apply_records.count({ where: { sn_code: final_sn_code, - applyTime: { [op.gte]: weekStart } + create_time: { [op.gte]: weekStart } } }), // 本月(如果提供了时间范围,则返回0,否则统计本月) startTime || endTime ? 0 : apply_records.count({ where: { sn_code: final_sn_code, - applyTime: { [op.gte]: monthStart } + create_time: { [op.gte]: monthStart } } }) ]); @@ -330,12 +330,12 @@ module.exports = { const records = await apply_records.findAll({ where: { sn_code: sn_code, - applyTime: { + create_time: { [op.gte]: sevenDaysAgo, [op.lte]: today } }, - attributes: ['applyTime'], + attributes: ['create_time'], raw: true }); @@ -350,7 +350,7 @@ module.exports = { // 统计当天的投递数量 const count = records.filter(record => { - const recordDate = new Date(record.applyTime); + const recordDate = new Date(record.create_time); recordDate.setHours(0, 0, 0, 0); return recordDate.getTime() === date.getTime(); }).length;