浏览代码

投资计算报表问题

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]);
         }
     }