Browse Source

Merge branch 'dev4.6.3.14' of http://192.168.3.207:8080/qmx/jy into dev4.6.3.14

zhangyuhan 3 years ago
parent
commit
f946ba2d4d

+ 14 - 7
src/jfw/front/shorturl.go

@@ -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
+}

+ 14 - 7
src/jfw/modules/app/src/app/front/shorturl.go

@@ -96,7 +96,8 @@ func (s *Short) Article(stype, id string) error {
 			s.T["canRead"] = true
 		}
 		//检验是否留资
-		ok, hasRetainedCapital := CNode(userId)
+		ok := CNode(userId)
+		hasRetainedCapital := hasRetainedCapital(userId, "jyarticle_see3_plus") //三级页source
 		if ok || hasRetainedCapital {
 			s.T["canRead"] = true
 		}
@@ -175,8 +176,7 @@ func (s *Short) Article(stype, id string) error {
 	return s.Redirect("/jyapp/free/mob/err")
 }
 
-func CNode(userId string) (bool, bool) {
-	hasRetainedCapital := false //是否留过资
+func CNode(userId string) bool {
 	rM := map[string]interface{}{}
 	rdata, ok := mongodb.Find("saleLeads", map[string]interface{}{
 		"userid": userId,
@@ -197,7 +197,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"])
@@ -212,12 +211,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
 }
 
 func GetbelongUserId(disWord, userId string) (belongUserId string) {
@@ -329,3 +328,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
+}

+ 0 - 1
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -1148,7 +1148,6 @@
     }
     //回车事件
     document.onkeydown = function () {
-      debugger
         if(window.event && window.event.keyCode == 13) {
             window.event.returnValue = false;
             //超级搜索