|
@@ -303,7 +303,8 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
async getFinalUsedData(tid, cid) {
|
|
|
- if (this.ctx.stage.status === audit.stage.status.checked) {
|
|
|
+ const stage = this.ctx.service.stage.getLastestStage(tid, true);
|
|
|
+ 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' +
|
|
@@ -317,7 +318,7 @@ module.exports = app => {
|
|
|
' WHERE scf.tid = ? And scf.cid = ? And s.order < ?';
|
|
|
const pre = await this.db.query(preSql, [tid, cid, stage.order]);
|
|
|
const sql = 'SELECT * FROM ' + this.tableName + ' WHERE sid';
|
|
|
- const curAll = await this.db.query(sql, [this.ctx.stage.id]);
|
|
|
+ const curAll = await this.db.query(sql, [stage.id]);
|
|
|
const cur = this.ctx.helper.filterLastestData(curAll, ['lid', 'pid', 'cid', 'cbid'], 'stimes', 'sorder');
|
|
|
return [...pre, ...cur];
|
|
|
}
|