Skip to content

Commit

Permalink
!809 修复BUG, 会员当前有等级的时候下订单会把当前等级给清空了。
Browse files Browse the repository at this point in the history
Merge pull request !809 from 云扬四海/fix-member-level-bug-0102
  • Loading branch information
YunaiV authored and gitee-org committed Jan 7, 2024
2 parents d728c36 + 39d26cc commit 761ab8a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;

import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
Expand Down Expand Up @@ -259,7 +260,7 @@ public void addExperience(Long userId, Integer experience, MemberExperienceBizTy
}

// 3. 更新会员表上的等级编号、经验值
memberUserService.updateUserLevel(user.getId(), levelRecord.getLevelId(), userExperience);
memberUserService.updateUserLevel(user.getId(), Optional.ofNullable(levelRecord.getLevelId()).orElse(user.getLevelId()), userExperience);
}

/**
Expand Down

0 comments on commit 761ab8a

Please sign in to comment.