|
@@ -112,9 +112,10 @@ module.exports = app => {
|
|
|
|
|
|
const sql = `SELECT pda.aid, pa.name, pa.company, pa.role, pa.mobile, pa.telephone, pda.times, pda.order, pda.status, pda.opinion, pda.begin_time, pda.end_time` +
|
|
|
` FROM ${this.tableName} pda LEFT JOIN ${this.ctx.service.projectAccount.tableName} pa ON pda.aid = pa.id` +
|
|
|
- ' WHERE pda.td_id = ? AND pda.times = ?';
|
|
|
+ ' WHERE pda.td_id = ? AND pda.times = ? ORDER BY pda.order';
|
|
|
//const flow = await this.db.query(sql, [detail.id, detail.status === auditConst.status.checkNo && !detail.readOnly ? detail.curTimes - 1 : detail.curTimes]);
|
|
|
- const flow = await this.db.query(sql, [detail.id, detail.curTimes]);
|
|
|
+ let flow = await this.db.query(sql, [detail.id, detail.curTimes]);
|
|
|
+ flow = this.ctx.helper.filterLastestData(flow, ['aid'], 'times', 'order');
|
|
|
flow.forEach(x => {
|
|
|
if (x.status === auditConst.status.checked) result.push(x);
|
|
|
if (x.status === auditConst.status.checking && !detail.readOnly) {
|