|
@@ -591,12 +591,10 @@ module.exports = app => {
|
|
|
const stages = await this.ctx.service.stage.getAllDataByCondition({ where: { tid: tid }, orders: [['order', 'desc']] });
|
|
|
for (const stage of stages) {
|
|
|
if (stage.status === audit.stage.status.checked) {
|
|
|
- const sql = 'SELECT scf.* ' +
|
|
|
- ' FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
|
|
|
- ' LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
|
|
|
- this.ctx.helper.whereSql({ tid, cid }, 'scf') + ' And s.order = ?';
|
|
|
- const pre = await this.db.query(sql, [stage.order]);
|
|
|
+ const sql = `SELECT * FROM ${this.ctx.service.stageChangeFinal.tableName} WHERE tid = ? and cid = ? AND sorder = ?`;
|
|
|
+ const pre = await this.db.query(sql, [tid, cid, stage.order]);
|
|
|
result.push(...pre);
|
|
|
+ break;
|
|
|
} else {
|
|
|
const sql = 'SELECT * FROM ' + this.tableName + this.ctx.helper.whereSql({ sid: stage.id, cid });
|
|
|
const curAll = await this.db.query(sql);
|