소스 검색

投资计算报表问题

MaiXinRong 4 달 전
부모
커밋
7598e8801e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/service/schedule_month.js

+ 1 - 1
app/service/schedule_month.js

@@ -109,7 +109,7 @@ module.exports = app => {
         }
 
         async getReportData(tid) {
-            const sql = `SELECT *, (@sum := @sum + plan_tp) as sum_plan_tp FROM ${this.tableName}, (SELECT @SUM := 0)T where tid = ? ORDER BY yearmonth;`;
+            const sql = `SELECT *, (@sum := @sum + IFNULL(plan_tp, 0)) as sum_plan_tp FROM ${this.tableName}, (SELECT @SUM := 0)T where tid = ? ORDER BY yearmonth;`;
             return await this.db.query(sql, [tid]);
         }
     }