|
@@ -233,7 +233,7 @@ module.exports = app => {
|
|
|
const stages = stage instanceof Array ? stage : [stage];
|
|
const stages = stage instanceof Array ? stage : [stage];
|
|
|
const condition = {};
|
|
const condition = {};
|
|
|
condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; }).join(',');
|
|
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);
|
|
return await this.db.queryOne(sql);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|