|
@@ -491,12 +491,13 @@ func (o *OriginalPower) SavePowerRecord(originalUrl string) {
|
|
|
}
|
|
|
|
|
|
// GetLeads 获取留资信息和判断是否满足
|
|
|
-func (o *OriginalPower) GetLeads() (leadOk bool, rM map[string]interface{}) {
|
|
|
+func (o *OriginalPower) CNode() (leadOk bool) {
|
|
|
// 查留资source
|
|
|
if hasRetainedCapital(o.UserId, []string{"pc_article_original_one", "app_article_original_one", "wx_article_original_one", "h5_article_original_one"}) {
|
|
|
leadOk = true
|
|
|
+ return
|
|
|
}
|
|
|
- rM = map[string]interface{}{}
|
|
|
+ rM := map[string]interface{}{}
|
|
|
rdata, ok := db.Mgo.Find("saleLeads", map[string]interface{}{
|
|
|
"userid": o.UserId,
|
|
|
}, `{"createtime":-1}`, nil, false, 0, 10)
|
|
@@ -518,8 +519,8 @@ func (o *OriginalPower) GetLeads() (leadOk bool, rM map[string]interface{}) {
|
|
|
delete(rM, "client")
|
|
|
}
|
|
|
if userinfo := config.Compatible.Select(o.UserId, `{"s_phone":1,"s_m_phone":1,"s_myemail":1,"s_company":1,"o_jy":1,"o_vipjy":1}`); userinfo != nil && len(*userinfo) > 0 {
|
|
|
- s_phone := util.ObjToString((*userinfo)["s_phone"])
|
|
|
- phone := util.If(s_phone == "", util.ObjToString((*userinfo)["s_m_phone"]), s_phone)
|
|
|
+ sPhone := util.ObjToString((*userinfo)["s_phone"])
|
|
|
+ phone := util.If(sPhone == "", util.ObjToString((*userinfo)["s_m_phone"]), sPhone)
|
|
|
if rM["phone"] == nil || rM["phone"] == "" {
|
|
|
rM["phone"] = phone
|
|
|
}
|
|
@@ -527,15 +528,12 @@ func (o *OriginalPower) GetLeads() (leadOk bool, rM map[string]interface{}) {
|
|
|
rM["company"] = util.ObjToString((*userinfo)["s_company"])
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
// 查之前的留资信息是否满足
|
|
|
- if !leadOk {
|
|
|
- if rM["name"] != nil && rM["name"] != "" && rM["phone"] != nil && rM["phone"] != "" && rM["company"] != nil && rM["company"] != "" && rM["position"] != nil && rM["position"] != "" && rM["companyType"] != "" {
|
|
|
- if rM["position"] != "总裁" && rM["position"] != "总经理" && (rM["branch"] == nil || rM["branch"] == "") {
|
|
|
- leadOk = false
|
|
|
- } else {
|
|
|
- leadOk = true
|
|
|
- }
|
|
|
+ if rM["name"] != nil && rM["name"] != "" && rM["phone"] != nil && rM["phone"] != "" && rM["company"] != nil && rM["company"] != "" && rM["position"] != nil && rM["position"] != "" && rM["companyType"] != "" {
|
|
|
+ if rM["position"] != "总裁" && rM["position"] != "总经理" && (rM["branch"] == nil || rM["branch"] == "") {
|
|
|
+ leadOk = false
|
|
|
+ } else {
|
|
|
+ leadOk = true
|
|
|
}
|
|
|
}
|
|
|
return
|