laiguoran 4 anni fa
parent
commit
3a48ac703e
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      app/service/material_audit.js

+ 1 - 1
app/service/material_audit.js

@@ -240,7 +240,7 @@ module.exports = app => {
                     };
                     mbhList.push(newMbh);
                 }
-                await transaction.insert(this.ctx.service.materialBillsHistory.tableName, mbhList);
+                if(mbhList.length !== 0) await transaction.insert(this.ctx.service.materialBillsHistory.tableName, mbhList);
 
                 const materialExponentData = await this.ctx.service.materialExponent.getAllDataByCondition({ where: { tid: this.ctx.tender.id } });
                 const mehList = [];