Commit 64849edd authored by licc's avatar licc

优化设置邀请码

parent 33505c8d
...@@ -289,6 +289,11 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U ...@@ -289,6 +289,11 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
return R.error("请填写注册时间早于自己的用户邀请码!"); return R.error("请填写注册时间早于自己的用户邀请码!");
} }
//4、判断用户推荐人邀请码是否为自己的邀请码
if (user.getUserId().equals(userCode.getUserId())) {
return R.error("推荐人不能是自己!");
}
//4、设置用户被邀请码 //4、设置用户被邀请码
user.setBeInvitedCode(inviteCode); user.setBeInvitedCode(inviteCode);
int count = usersMapper.edit(user); int count = usersMapper.edit(user);
......
package cn.wisenergy; package cn.wisenergy;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment