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) {
         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]);
             return await this.db.query(sql, [tid]);
         }
         }
     }
     }