ソースを参照

优化sql,把冗余的material_list数据清除

laiguoran 3 年 前
コミット
65ef8596bb
1 ファイル変更2 行追加0 行削除
  1. 2 0
      app/service/material.js

+ 2 - 0
app/service/material.js

@@ -194,6 +194,8 @@ module.exports = app => {
                         ex_calc: JSON.stringify(ex_calc),
                     };
                     await transaction.update(this.tableName, updateMaterialData);
+                    // 删除material_list表冗余数据,减少表数据量
+                    await transaction.delete(this.ctx.service.materialList.tableName, { tid: this.ctx.tender.id, gather_qty: null });
                 }
 
                 await transaction.commit();