cup 2 years ago
parent
commit
9ddf6cf2a0

+ 6 - 0
mp-service/src/main/java/com/qs/mp/channel/service/impl/ChannelUserRelServiceImpl.java

@@ -7,6 +7,8 @@ import com.qs.mp.channel.service.IChannelUserRelService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.Objects;
+
 /**
  * <p>
  * 经销商的用户 服务实现类
@@ -30,6 +32,10 @@ public class ChannelUserRelServiceImpl extends ServiceImpl<ChannelUserRelMapper,
 
 	@Override
 	public void bindUser(Long userId, Long channelId) {
+		// 经销商id为空则不进行绑定
+		if (Objects.isNull(channelId) || channelId == 0) {
+			return;
+		}
 		// 线下票如果用户没被绑定,则保存经销商用户绑定关系
 		ChannelUserRel channelUserRel = this.getOne(
 				new LambdaQueryWrapper<ChannelUserRel>()