|
@@ -105,21 +105,22 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
async getLastestStageData2(tid, sid, lid) {
|
|
|
- const condition = { tender_id: tid, sid, lid };
|
|
|
- if (!lid) delete condition.lid;
|
|
|
+ const filterSql = lid ? this._getFilterSql({lid}) : '';
|
|
|
+ const sql = 'Select * From ' + this.departTableName(tid) +
|
|
|
+ ' Where tid = ? and sid = ? ' + filterSql;
|
|
|
|
|
|
- const result = this.db.select(this.departTableName(tid), { where: condition });
|
|
|
+ const result = await this.db.query(sql, [tid, sid]);
|
|
|
const stageBills = this.ctx.helper.filterLastestData(result, 'lid');
|
|
|
if (!lid || lid instanceof Array) return stageBills;
|
|
|
return stageBills[0];
|
|
|
}
|
|
|
|
|
|
- async getAuditorStageData2(tid, sid, times, order, where) {
|
|
|
- const filterSql = this._getFilterSql(where);
|
|
|
+ async getAuditorStageData2(tid, sid, times, order, lid) {
|
|
|
+ const filterSql = lid ? this._getFilterSql({lid}) : '';
|
|
|
const sql = 'Select * From ' + this.departTableName(tid) +
|
|
|
- ' Where tender_id = ? and sid = ? And (`times` < ? OR (`times` = ? AND `order` <= ?)) ' + filterSql;
|
|
|
+ ' Where tid = ? and sid = ? And (`times` < ? OR (`times` = ? AND `order` <= ?)) ' + filterSql;
|
|
|
|
|
|
- const result = this.db.query(sql, [tid, sid, times, times, order]);
|
|
|
+ const result = await this.db.query(sql, [tid, sid, times, times, order]);
|
|
|
const stageBills = this.ctx.helper.filterLastestData(result, 'lid');
|
|
|
if (!lid || lid instanceof Array) return stageBills;
|
|
|
return stageBills[0];
|