Prechádzať zdrojové kódy

无任何审批人时,max_order计算问题

MaiXinRong 2 rokov pred
rodič
commit
9db0ad083c
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      app/service/stage_audit.js

+ 1 - 1
app/service/stage_audit.js

@@ -1961,7 +1961,7 @@ module.exports = app => {
                     const auditors = await this.ctx.service.stageAudit.getAuditors(stageId, i);
                     const group = this.ctx.helper.groupAuditors(auditors);
                     const historyGroup = [];
-                    const max_order = group[group.length - 1][0].audit_order;
+                    const max_order = group.length > 0 && group[group.length - 1].length > 0 ? group[group.length - 1][0].audit_order : -1;
                     for (const g of group) {
                         const his = {
                             beginYear: '', beginDate: '', beginTime: '', endYear: '', endDate: '', endTime: '',