|
@@ -323,7 +323,17 @@ module.exports = app => {
|
|
|
' WHERE ((ma.`aid` = ? and ma.`status` = ?) OR (m.`uid` = ? and ma.`status` = ? and m.`status` = ? and ma.`times` = (m.`times`-1)))' +
|
|
|
' and ma.`caid` = m.`id` and ma.`tid` = t.`id` ORDER BY ma.`begin_time` DESC';
|
|
|
const sqlParam = [this.tableName, this.ctx.service.changeApply.tableName, this.ctx.service.tender.tableName, auditorId, auditConst.status.checking, auditorId, auditConst.status.checkNo, auditConst.status.checkNo];
|
|
|
- return await this.db.query(sql, sqlParam);
|
|
|
+ const result = await this.db.query(sql, sqlParam);
|
|
|
+ // 过滤result中存在重复sid的值, 保留最新的一条
|
|
|
+ const filterResult = [];
|
|
|
+ const caidArr = [];
|
|
|
+ for (const r of result) {
|
|
|
+ if (caidArr.indexOf(r.caid) === -1) {
|
|
|
+ filterResult.push(r);
|
|
|
+ caidArr.push(r.caid);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return filterResult;
|
|
|
}
|
|
|
|
|
|
/**
|