Procházet zdrojové kódy

合同支付,基数查询sql问题

MaiXinRong před 1 dnem
rodič
revize
18e8dcad30
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      app/service/stage_bonus.js

+ 1 - 1
app/service/stage_bonus.js

@@ -233,7 +233,7 @@ module.exports = app => {
             const stages = stage instanceof Array ? stage : [stage];
             const condition = {};
             condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; }).join(',');
-            const sql = `SELECT SUM(IF(tp > 0, tp, 0)) AS positive_tp, SUM(IF(tp < 0, tp, 0)) AS negative_tp, SUM(IF(b_type = '奖金', tp, 0) AS reward_tp, SUM(IF(b_type = '罚金', tp, 0)) AS forfeit_tp, SUM(tp) AS sum_tp From ${this.tableName} ` + this.ctx.helper.whereSql(condition);
+            const sql = `SELECT SUM(IF(tp > 0, tp, 0)) AS positive_tp, SUM(IF(tp < 0, tp, 0)) AS negative_tp, SUM(IF(b_type = '奖金', tp, 0)) AS reward_tp, SUM(IF(b_type = '罚金', tp, 0)) AS forfeit_tp, SUM(tp) AS sum_tp From ${this.tableName} ` + this.ctx.helper.whereSql(condition);
             return await this.db.queryOne(sql);
         }
     }