lrf пре 2 година
родитељ
комит
6d5001a140
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      app/service/trade/cart.js

+ 3 - 0
app/service/trade/cart.js

@@ -172,6 +172,9 @@ class CartService extends CrudService {
       // 套装查询库存
       const cartData = await this.model.findById(cartId);
       const res = await this.checkSetGoodsNum(cartData, num);
+      if (update && cartId) {
+        await this.model.updateOne({ _id: cartId }, { num });
+      }
       return res;
     }
     const { populate } = this.ctx.service.shop.goodsSpec.getRefMods();