lrf пре 2 година
родитељ
комит
d76d7dc5b0
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      app/service/zrOrder.js

+ 4 - 0
app/service/zrOrder.js

@@ -50,6 +50,10 @@ class ZrOrderService extends CrudService {
       const pointData = { customer, point: costTotal, time: buy_time, source: '-2', source_id: order_id };
       this.tran.insert('Point', pointData);
       // #endregion
+      // #region 库存处理
+      const newNum = this.ctx.minus(_.get(goodsInfo, 'num'), buy_num);
+      this.tran.update('ZrGoods', goods, { num: newNum });
+      // #endregion
       await this.tran.run();
       return 'ok';
     } catch (error) {