|
|
@@ -108,15 +108,17 @@ public class PromotionUserCouponServiceImpl extends ServiceImpl<PromotionUserCou
|
|
|
vo.setRemainCount(batch.getRemainCount());
|
|
|
vo.setEndTime(batch.getEndTime());
|
|
|
|
|
|
- // 查询券规则
|
|
|
- PromotionCouponRule rule = ruleMapper.selectOne(
|
|
|
+ // 查询券规则(商品券可含多条)
|
|
|
+ List<PromotionCouponRule> rules = ruleMapper.selectList(
|
|
|
new LambdaQueryWrapper<PromotionCouponRule>()
|
|
|
.eq(PromotionCouponRule::getBatchId, batch.getId()));
|
|
|
- if (rule != null) {
|
|
|
- vo.setThreshold(rule.getThreshold());
|
|
|
- vo.setAmount(rule.getAmount());
|
|
|
- vo.setDiscountRate(rule.getDiscountRate());
|
|
|
- vo.setIsMutex(rule.getIsMutex());
|
|
|
+ vo.setRules(rules);
|
|
|
+ if (!rules.isEmpty()) {
|
|
|
+ PromotionCouponRule first = rules.get(0);
|
|
|
+ vo.setThreshold(first.getThreshold());
|
|
|
+ vo.setAmount(first.getAmount());
|
|
|
+ vo.setDiscountRate(first.getDiscountRate());
|
|
|
+ vo.setIsMutex(first.getIsMutex());
|
|
|
}
|
|
|
|
|
|
// 检查用户是否已领取
|