Forráskód Böngészése

bug:下单,优惠券判断错误

lrf 2 éve
szülő
commit
975a88af51
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      app/service/trade/order.js

+ 1 - 1
app/service/trade/order.js

@@ -104,7 +104,7 @@ class OrderService extends CrudService {
       // 处理库存,删除购物车
       await this.dealGoodsNum(goodsData);
       // 处理优惠券,改为使用过
-      if (coupon.length > 1) await this.ctx.service.user.userCoupon.useCoupon(coupon, this.tran);
+      if (coupon.length > 0) await this.ctx.service.user.userCoupon.useCoupon(coupon, this.tran);
       await this.tran.run();
       // 创建定时任务(mq死信机制任务)
       await this.toMakeTask(order_id);