lrf hace 2 años
padre
commit
d76d7dc5b0
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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 };
       const pointData = { customer, point: costTotal, time: buy_time, source: '-2', source_id: order_id };
       this.tran.insert('Point', pointData);
       this.tran.insert('Point', pointData);
       // #endregion
       // #endregion
+      // #region 库存处理
+      const newNum = this.ctx.minus(_.get(goodsInfo, 'num'), buy_num);
+      this.tran.update('ZrGoods', goods, { num: newNum });
+      // #endregion
       await this.tran.run();
       await this.tran.run();
       return 'ok';
       return 'ok';
     } catch (error) {
     } catch (error) {