|
@@ -322,16 +322,20 @@ public class MarketingServiceImpl extends ServiceImpl<MarketingMapper, Marketing
|
|
|
}
|
|
|
|
|
|
|
|
|
+ // 邀请码解码,被助力人id
|
|
|
+ Long helpedUserId = MarketingUtils.decodeInviteCode(inviteCode);
|
|
|
+ if (userId.equals(helpedUserId)) {
|
|
|
+ throw new ServiceException("不能助力自己哦");
|
|
|
+ }
|
|
|
+
|
|
|
// 判断是否已经助力过
|
|
|
int count = marketingUserCodeService.count(new LambdaQueryWrapper<MarketingUserCode>()
|
|
|
- .eq(MarketingUserCode::getUserId, userId)
|
|
|
+ .eq(MarketingUserCode::getHelpUserId, userId)
|
|
|
.eq(MarketingUserCode::getMarketingId, marketingHelpParam.getMarketingId()));
|
|
|
if (count > 0) {
|
|
|
throw new ServiceException("您已经助力过了");
|
|
|
}
|
|
|
|
|
|
- // 邀请码解码,被助力人id
|
|
|
- Long helpedUserId = MarketingUtils.decodeInviteCode(inviteCode);
|
|
|
|
|
|
// 生成抽奖码
|
|
|
String code = "";
|