MaiXinRong 4 месяцев назад
Родитель
Сommit
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]);
         }
     }