Преглед изворни кода

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

lrf пре 2 година
родитељ
комит
975a88af51
1 измењених фајлова са 1 додато и 1 уклоњено
  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);