Explorar el Código

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

lrf hace 2 años
padre
commit
975a88af51
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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);