瀏覽代碼

汇总,汇总周期问题

MaiXinRong 5 年之前
父節點
當前提交
6aceda6a8e
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      app/service/rpt_gather_memory.js

+ 4 - 4
app/service/rpt_gather_memory.js

@@ -456,13 +456,13 @@ module.exports = app => {
 
             const times = zone.split(' - ');
             if (times.length !== 2) throw '选择的汇总周期无效';
-            const beginTime = moment(times[0], 'YYYY-MM').date();
-            const endTime = moment(times[1], 'YYYY-MM').date();
+            const beginTime = moment(times[0], 'YYYY-MM');
+            const endTime = moment(times[1], 'YYYY-MM');
 
             const stages = await this.ctx.service.stage.getAllDataByCondition({ where: { tid: tender.id } });
             for (const stage of stages) {
-                const sTime = moment(stage.s_time, 'YYYY-MM').date();
-                if (sTime >= beginTime && sTime <= endTime) {
+                const sTime = moment(stage.s_time, 'YYYY-MM');
+                if (sTime.isBetween(beginTime, endTime, null, '[]')) {
                     await this.ctx.service.stage.doCheckStage(stage);
                     await this.ctx.service.stage.checkStageGatherData(stage);