|
@@ -38,10 +38,12 @@ module.exports = app => {
|
|
|
async getAuditorStagePay(pid, sid, times, order) {
|
|
|
const pidSql = pid instanceof Array ? ' And SP.`pid` in (' + pid.join(',') + ')' : 'And SP.`pid` = ' + pid;
|
|
|
const sql = 'SELECT SP.*, P.`csorder`, P.`cstimes`, P.`csaorder`, P.`order`, P.uid, P.minus, P.ptype, P.sprice, P.sexpr, P.rprice, P.rexpr, P.is_yf, P.dl_type, P.dl_count, P.dl_tp_type, P.dl_tp ' +
|
|
|
- ' FROM ?? As SP, ?? As P ' +
|
|
|
+ ' FROM ' + this.tableName + ' As SP ' +
|
|
|
+ ' LEFT JOIN ' + this.ctx.service.pay.tableName + ' As P ' +
|
|
|
+ ' ON SP.pid = p.id' +
|
|
|
' WHERE SP.`sid` = ? AND SP.`stimes` = ? AND SP.`sorder` = ? AND SP.`pid` = P.`id` AND P.`valid`' + pidSql +
|
|
|
' ORDER BY P.`order`';
|
|
|
- const sqlParam = [this.tableName, this.ctx.service.pay.tableName, sid, times, order, pid];
|
|
|
+ const sqlParam = [sid, times, order, pid];
|
|
|
if (pid instanceof Array) {
|
|
|
return await this.db.query(sql, sqlParam);
|
|
|
} else {
|
|
@@ -61,10 +63,12 @@ module.exports = app => {
|
|
|
const sql = 'SELECT SP.*,' +
|
|
|
' P.`csorder`, P.`cstimes`, P.`csaorder`, P.`order`, P.uid, P.minus, P.ptype, P.sprice, P.sexpr,' +
|
|
|
' P.rprice, P.rexpr, P.is_yf, P.dl_type, P.dl_count, P.dl_tp_type, P.dl_tp, P.name as pName ' +
|
|
|
- ' FROM ?? As SP, ?? As P ' +
|
|
|
+ ' FROM ' + this.tableName + ' As SP ' +
|
|
|
+ ' LEFT JOIN ' + this.ctx.service.pay.tableName + ' As P ' +
|
|
|
+ ' ON SP.pid = p.id' +
|
|
|
' WHERE SP.`sid` = ? AND SP.`stimes` = ? AND SP.`sorder` = ? AND SP.`pid` = P.`id` AND P.`valid`' +
|
|
|
' ORDER BY P.`order`';
|
|
|
- const sqlParam = [this.tableName, this.ctx.service.pay.tableName, sid, times, order];
|
|
|
+ const sqlParam = [sid, times, order];
|
|
|
return await this.db.query(sql, sqlParam);
|
|
|
}
|
|
|
|