|
@@ -611,8 +611,10 @@ module.exports = app => {
|
|
|
where: { tender_id: tenderId, times },
|
|
|
columns: ['tender_id', 'audit_order', 'audit_id', 'audit_type', 'audit_ledger_id'],
|
|
|
});
|
|
|
- const insertAuditors = orgAuditors.map(x => {
|
|
|
- return { ...x, times: times + 1, status: auditConst.status.uncheck };
|
|
|
+ const insertAuditors = [];
|
|
|
+ orgAuditors.forEach(x => {
|
|
|
+ if (insertAuditors.find(y => { return y.audit_id === x.audit_id && y.audit_type === x.audit_type})) return;
|
|
|
+ insertAuditors.push({ ...x, times: times + 1, status: auditConst.status.uncheck });
|
|
|
});
|
|
|
await transaction.insert(this.tableName, insertAuditors);
|
|
|
|