lrf 2 lat temu
rodzic
commit
c64a67530a
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      app/service/trade/order.js
  2. 1 1
      app/service/user/userCoupon.js

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

@@ -103,7 +103,7 @@ class OrderService extends CrudService {
       if (coupon.length > 0) await this.ctx.service.user.userCoupon.useCoupon(coupon, this.tran);
       await this.tran.run();
       // 创建定时任务(mq死信机制任务)
-      // await this.toMakeTask(order_id);
+      await this.toMakeTask(order_id);
       return order_id;
     } catch (error) {
       await this.tran.rollback();

+ 1 - 1
app/service/user/userCoupon.js

@@ -294,7 +294,7 @@ class UserCouponService extends CrudService {
       // 有最低消费的限制,就需要看看下满足条件的商品够不够这个金额
       // 消费下限 大于 满足优惠券使用的商品的消费总额,则不能使用这个券,消费的钱不够
       // 且这个地方应该报错
-      if (this.ctx.minus(limit, goodsTotal) > 0) throw new BusinessError(ErrorCode.DATA_INVALID, `消费券:${coupon.name}不满足使用条件`);
+      if (this.ctx.minus(limit, goodsTotal) <= 0) throw new BusinessError(ErrorCode.DATA_INVALID, `消费券:${coupon.name}不满足使用条件`);
     }
     // 减免设置转换成 实际减免总金额:
     // 满减则直接就是 min(设置的满x减y的y);