|
@@ -283,8 +283,11 @@ func FormatData(data map[string]interface{}, item string) (bool, bool, bool) {
|
|
|
}
|
|
|
log.Println(333, cluename)
|
|
|
cluename = strings.ReplaceAll(cluename, " ", "")
|
|
|
- isGroup, isCommerce := GetCompanyType(cluename, uId) //判断是否集团公司、工商库
|
|
|
- if source == "0104" || strings.HasPrefix(belong_to, "02") || source == "0102" || source == "0103" || phone == "" { //参照用户来源代码表
|
|
|
+ isGroup, isCommerce := GetCompanyType(cluename, uId) //判断是否集团公司、工商库
|
|
|
+ //获取用户渠道
|
|
|
+ channel := GetUserChannel(uId)
|
|
|
+ _, exit := UserChannel[channel]
|
|
|
+ if source == "0104" || strings.HasPrefix(belong_to, "02") || source == "0102" || source == "0103" || phone == "" || (channel != "" && exit) { //参照用户来源代码表
|
|
|
//log.Println("线索分配失败,线索过滤!!", item, source, phone, userId)
|
|
|
//saveHlyj(belong_to, item, phone, name, sourceName, cluename, position, nowTime, isGroup, isCommerce)
|
|
|
return true, true, true
|
|
@@ -2264,3 +2267,27 @@ var phoneRegex = regexp.MustCompile(`^1[3-9]\d{9}$`)
|
|
|
func ValidatePhone(phone string) bool {
|
|
|
return phoneRegex.MatchString(phone)
|
|
|
}
|
|
|
+
|
|
|
+// 获取用户渠道信息
|
|
|
+func GetUserChannel(uid string) string {
|
|
|
+ channel := ""
|
|
|
+ userId := ""
|
|
|
+ data := TiDb.FindOne("dwd_f_userbase_baseinfo", map[string]interface{}{
|
|
|
+ "uid": uid,
|
|
|
+ "status": 1,
|
|
|
+ }, "userid", "")
|
|
|
+ if data != nil {
|
|
|
+ userId = gconv.String((*data)["userid"])
|
|
|
+ }
|
|
|
+ if userId == "" {
|
|
|
+ return channel
|
|
|
+ }
|
|
|
+ //查找注册日志表
|
|
|
+ registerData, _ := MgoLog.FindOne("register_log", map[string]interface{}{
|
|
|
+ "userid": userId,
|
|
|
+ })
|
|
|
+ if registerData != nil {
|
|
|
+ channel = gconv.String((*registerData)["source"])
|
|
|
+ }
|
|
|
+ return channel
|
|
|
+}
|