|
@@ -155,7 +155,8 @@ func (s *Short) Article(stype, id string) error {
|
|
|
s.T["isMember"] = isMember
|
|
|
s.T["isEntniche"] = isEntniche
|
|
|
s.T["isEntnicheNew"] = isEntnicheNew
|
|
|
- node, hasRetainedCapital := CNode(userId)
|
|
|
+ node := CNode(userId)
|
|
|
+ hasRetainedCapital := hasRetainedCapital(userId, "jyarticle_see3_plus") //三级页留资source
|
|
|
var nodeStr string
|
|
|
if node || hasRetainedCapital {
|
|
|
nodeStr = "true"
|
|
@@ -377,9 +378,8 @@ func (s *Short) Article(stype, id string) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func CNode(userId string) (bool, bool) {
|
|
|
+func CNode(userId string) bool {
|
|
|
rM := map[string]interface{}{}
|
|
|
- hasRetainedCapital := false
|
|
|
rdata, ok := mongodb.Find("saleLeads", map[string]interface{}{
|
|
|
"userid": userId,
|
|
|
}, `{"createtime":-1}`, nil, false, 0, 10)
|
|
@@ -399,7 +399,6 @@ func CNode(userId string) (bool, bool) {
|
|
|
delete(rM, "userid")
|
|
|
delete(rM, "createtime")
|
|
|
delete(rM, "client")
|
|
|
- hasRetainedCapital = true
|
|
|
}
|
|
|
if userinfo, ok := mongodb.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,"s_myemail":1,"s_company":1,"o_jy":1,"o_vipjy":1}`); userinfo != nil && ok && len(*userinfo) > 0 {
|
|
|
s_phone := util.ObjToString((*userinfo)["s_phone"])
|
|
@@ -414,12 +413,12 @@ func CNode(userId string) (bool, bool) {
|
|
|
if rM["name"] != nil && rM["name"] != "" && rM["phone"] != nil && rM["phone"] != "" && rM["company"] != nil && rM["company"] != "" && rM["position"] != nil && rM["position"] != "" {
|
|
|
|
|
|
if rM["position"] != "总裁" && rM["position"] != "总经理" && (rM["branch"] == nil || rM["branch"] == "") {
|
|
|
- return false, hasRetainedCapital
|
|
|
+ return false
|
|
|
}
|
|
|
- return true, hasRetainedCapital
|
|
|
+ return true
|
|
|
|
|
|
}
|
|
|
- return false, hasRetainedCapital
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
//查看公告详情次数限制
|
|
@@ -687,3 +686,11 @@ func RemoveDuplicatesAndEmpty(a []string) (ret []string) {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+//该节点是否留资
|
|
|
+func hasRetainedCapital(uid, source string) bool {
|
|
|
+ if count, err := mongodb.CountByErr("saleLeads", map[string]interface{}{"userid": uid, "source": source}); err != nil || count > 0 {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+}
|