MaiXinRong 11 месяцев назад
Родитель
Сommit
b2ecae4b67
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      app/service/ledger_audit.js

+ 2 - 2
app/service/ledger_audit.js

@@ -117,7 +117,7 @@ module.exports = app => {
 
                     sql = 'SELECT la.`audit_id`, pa.`name`, pa.`company`, pa.`role`, la.`times`, la.`tender_id`, la.audit_order, la.audit_type, la.audit_ledger_id ' +
                         '  FROM ?? AS la Left Join ?? AS pa On la.`audit_id` = pa.`id` ' +
-                        '  WHERE la.`sid` = ? and la.`audit_order` = ? and la.`times` = ?';
+                        '  WHERE la.`tender_id` = ? and la.`audit_order` = ? and la.`times` = ?';
                     sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, tenderId, cur.order, parseInt(times) - 1];
                     auditor = await this.db.query(sql, sqlParam);
                     break;
@@ -977,7 +977,7 @@ module.exports = app => {
                 const existAudit = auditList.find(x => { return x.audit_id === lastId });
                 let order = auditList.length > 0 ? auditList.reduce((rst, a) => { return Math.max(rst, a.audit_order)}, 0) + 1 : 1; // 最大值 + 1
                 if (existAudit) {
-                    await transaction.delete(this.tableName, { sid: stage.id, times: stage.times, audit_id: lastId });
+                    await transaction.delete(this.tableName, { tender_id: tender.id, times: tender.ledger_times, audit_id: lastId });
                     const sameOrder = auditList.filter(x => { return x.audit_order === existAudit.audit_order });
                     if (sameOrder.length === 1) {
                         const updateData = [];