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