Explorar el Código

修复变更重新审批bug

ellisran hace 1 año
padre
commit
b8bb061c0b
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      app/service/change.js

+ 2 - 1
app/service/change.js

@@ -1691,7 +1691,7 @@ module.exports = app => {
                 const updateChangeList = [];
                 for (const cl of changeList) {
                     const audit_amount = cl.audit_amount.split(',');
-                    const last_amount = audit_amount[audit_amount.length - 1];
+                    const last_amount = audit_amount[audit_amount.length - 1] ? audit_amount[audit_amount.length - 1] : 0;
                     audit_amount.splice(-1, 1);
                     const list_update = {
                         id: cl.id,
@@ -1741,6 +1741,7 @@ module.exports = app => {
                 await this.ctx.helper.sendWechat(zsAudit.uid, smsTypeConst.const.BG, smsTypeConst.judge.approval.toString(), wxConst.template.change, wechatData);
 
             } catch (error) {
+                console.log(error);
                 await this.transaction.rollback();
                 result = false;
             }