Commit 04fdc70f582bc869495c07d8178c8732eaa64dba
1 parent
257e3c6a
修复优惠券回收后,领取数量和剩余数量不更新的问题
Showing
1 changed file
with
2 additions
and
2 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java
| ... | ... | @@ -140,8 +140,8 @@ public class CouponServiceImpl implements CouponService { |
| 140 | 140 | if (deleteCount == 0) { |
| 141 | 141 | throw exception(COUPON_DELETE_FAIL_USED); |
| 142 | 142 | } |
| 143 | - // 减少优惠劵模板的领取数量 -1 | |
| 144 | - couponTemplateService.updateCouponTemplateTakeCount(id, -1); | |
| 143 | + // 传入优惠券模板ID,减少优惠劵模板的领取数量 -1 | |
| 144 | + couponTemplateService.updateCouponTemplateTakeCount(couponMapper.selectById(id).getTemplateId(), -1); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | @Override | ... | ... |