ソースを参照

报表数据问题

MaiXinRong 1 ヶ月 前
コミット
a62a455a68
3 ファイル変更7 行追加7 行削除
  1. 3 3
      app/service/phase_pay.js
  2. 2 2
      app/service/report.js
  3. 2 2
      app/service/report_memory.js

+ 3 - 3
app/service/phase_pay.js

@@ -81,7 +81,7 @@ module.exports = app => {
          */
         async getAllPhasePay (tid, sort = 'ASC') {
             const result = await this.getAllDataByCondition({
-                where: {tid: tid},
+                where: { tid: tid },
                 orders: [['phase_order', sort]],
             });
             this.analysisPhasePay(result);
@@ -514,11 +514,11 @@ module.exports = app => {
         }
 
         async checkStageRelaPhasePay(tid, sid) {
-            if (this.ctx.stageRelaPhasePay === undefined) return;
+            if (this.ctx.stageRelaPhasePay !== undefined) return;
 
             const allPhase = await this.getAllPhasePay(tid);
             for (const phase of allPhase) {
-                if (phase.rela_stage.find(x => { return x.id === sid; })) {
+                if (phase.rela_stage.find(x => { return x.stage_id === sid; })) {
                     await this.doCheckPhase(phase);
                     this.ctx.stageRelaPhasePay = phase;
                     return;

+ 2 - 2
app/service/report.js

@@ -510,11 +510,11 @@ module.exports = app => {
                             runnableKey.push(filter);
                             break;
                         case 'mem_phase_pay':
-                            runnableRst.push(service.reportMemory.getPhasePay(params.stage_id));
+                            runnableRst.push(service.reportMemory.getPhasePay(params.tender_id, params.stage_id));
                             runnableKey.push(filter);
                             break;
                         case 'mem_phase_pay_detail':
-                            runnableRst.push(service.reportMemory.getPhasePayDetail(params.stage_id));
+                            runnableRst.push(service.reportMemory.getPhasePayDetail(params.tender_id, params.stage_id));
                             runnableKey.push(filter);
                             break;
                         default:

+ 2 - 2
app/service/report_memory.js

@@ -1740,7 +1740,7 @@ module.exports = app => {
         async getPhasePay(tid, sid) {
             await this.ctx.service.tender.checkTender(tid);
             await this.ctx.service.stage.checkStage(sid);
-            await this.ctx.service.phasePay.checkStageRelaPhasePay(sid);
+            await this.ctx.service.phasePay.checkStageRelaPhasePay(tid, sid);
 
             return this.ctx.stageRelaPhasePay || {};
         }
@@ -1748,7 +1748,7 @@ module.exports = app => {
         async getPhasePayDetail(tid, sid) {
             await this.ctx.service.tender.checkTender(tid);
             await this.ctx.service.stage.checkStage(sid);
-            await this.ctx.service.phasePay.checkStageRelaPhasePay(sid);
+            await this.ctx.service.phasePay.checkStageRelaPhasePay(tid, sid);
 
             if (!this.ctx.stageRelaPhasePay) return [];
             const data = this.ctx.service.phasePayDetail.getDetailData(this.ctx.stageRelaPhasePay);