|
@@ -396,7 +396,7 @@ module.exports = app => {
|
|
|
const tender = await this._getTender(stage);
|
|
|
const sql = 'SELECT sc.*, c.quality FROM ' + this.tableName + ' sc' +
|
|
|
' LEFT JOIN ' + this.ctx.service.change.tableName + ' c ON sc.cid = c.cid' +
|
|
|
- ' WHERE sid = ?';
|
|
|
+ ' WHERE sid = ? ' + (stage.readOnly ? `and (stimes < ${stage.curTimes} or (stimes = ${stage.curTimes} and sorder <= ${stage.curOrder}))` : '');
|
|
|
let data = await this.db.query(sql, [stage.id]);
|
|
|
data = helper.filterLastestData(data, ['lid', 'pid', 'cbid'], 'stimes', 'sorder');
|
|
|
const bqData = [];
|