This commit is contained in:
zhouwentao 2024-03-20 16:49:04 +08:00
parent cd8243e09f
commit 705e17684a
2 changed files with 13 additions and 5 deletions

View File

@ -55,10 +55,17 @@ public class MiniUserService {
//先判断是不是VIP激活的
List<YxVipCard> vipCardList = yxVipCardService.selectByUserId(userId);
if (CollectionUtils.isNotEmpty(vipCardList)) {
YxVipCard yxVipCard = vipCardList.get(0);
skuCode =yxVipCard.getSkuCode();
validTime = yxVipCard.getValidDate();
activationTime = yxVipCard.getUsedTime();
for (YxVipCard yxVipCard : vipCardList) {
if (yxVipCard.getValidDate()==null) {
continue;
}
if (yxVipCard.getValidDate().getTime()<=new Date().getTime()) {
continue;
}
skuCode =yxVipCard.getSkuCode();
validTime = yxVipCard.getValidDate();
activationTime = yxVipCard.getUsedTime();
}
}
//判断支付订单中的

View File

@ -71,7 +71,8 @@ public class YxVipCardServiceImpl extends ServiceImpl<YxVipCardMapper, YxVipCard
}
LambdaQueryWrapper<YxVipCard> yxVipCardLambdaQueryWrapper = new LambdaQueryWrapper<>();
yxVipCardLambdaQueryWrapper.eq(YxVipCard::getUserId,userId);
yxVipCardLambdaQueryWrapper.orderByDesc(YxVipCard::getUsedTime);
yxVipCardLambdaQueryWrapper.orderByAsc(YxVipCard::getValidDate);
//yxVipCardLambdaQueryWrapper.orderByDesc(YxVipCard::getUsedTime);
return this.list(yxVipCardLambdaQueryWrapper);
}