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();