WH01243 3 سال پیش
والد
کامیت
096e0cad9b

+ 1 - 1
src/entnichePc.json

@@ -1,4 +1,4 @@
 {
-	"entnichePcUser": [14595,442,1686,1685,1711],
+	"entnichePcUser": [14595,442,1686,1685,1711,674],
 	"hideEntnicheMenu": [1711,442]
 }

+ 5 - 5
src/jfw/filter/filter.go

@@ -1,7 +1,7 @@
 package filter
 
 import (
-	"jfw/jyutil"
+	//"jfw/jyutil"
 	"net/http"
 	"time"
 
@@ -17,9 +17,9 @@ type Filter struct {
 }
 
 func (f *Filter) Do(w http.ResponseWriter, r *http.Request) bool {
-	session := xweb.RootApp().SessionManager.Session(r, w)
-	getSession := session.GetMultiple()
-	if !(&logFilter{w, r, session, getSession, make(map[string]interface{})}).Do() {
+	//session := xweb.RootApp().SessionManager.Session(r, w)
+	//getSession := session.GetMultiple()
+	/*if !(&logFilter{w, r, session, getSession, make(map[string]interface{})}).Do() {
 		return false
 	}
 	if !(&jyutil.SessionKeep{w, r, session, getSession, make(map[string]interface{})}).Do() {
@@ -33,6 +33,6 @@ func (f *Filter) Do(w http.ResponseWriter, r *http.Request) bool {
 	}
 	if !(&pcFilter{w, r, session, getSession}).Do() {
 		return false
-	}
+	}*/
 	return true
 }

+ 1 - 1
src/jfw/front/frontRouter.go

@@ -162,7 +162,7 @@ func (this *CommonRouter) BigpcPage(htmlPage string) error {
 	return this.doPcBigPage(htmlPage)
 }
 
-var bigVipFreePageReg = regexp.MustCompile(`set_.*|free|unit_portrayal|analysis_(search|result)|pro_follow_detail`)
+var bigVipFreePageReg = regexp.MustCompile(`set_.*|free|unit_portrayal|analysis_(search|result)|pro_follow_detail|client_portrayal`)
 
 func (this *CommonRouter) doPcBigPage(pageSign string) error {
 	userid, _ := this.GetSession("userId").(string)

+ 20 - 4
src/jfw/modules/app/src/app/front/front.go

@@ -232,10 +232,28 @@ func isInTSguide(userid string) bool {
 	if userid == "" {
 		return false
 	}
-	data, ok := mongodb.FindById("user", userid, `{"o_jy":1,"i_ts_guide":1,"":1,"i_member_status":1,"i_vip_status":1}`)
+	data, ok := mongodb.FindById("user", userid, `{"o_jy":1,"i_ts_guide":1,"":1,"i_member_status":1,"i_vip_status":1,"s_phone":1,"s_m_phone":1}`)
 	if ok {
+		/*phone := ""
+		if s_phone, _ := (*data)["s_phone"].(string); s_phone != "" {
+			phone = s_phone
+		} else if s_m_phone, _ := (*data)["s_m_phone"].(string); s_m_phone != "" {
+			phone = s_m_phone
+		}
+		isEnt := false
+		if phone != "" {
+			//已购买企业未过期
+			if entInfo := public.Mysql.SelectBySql(`SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len((*entInfo)) > 0 {
+				for _, v := range (*entInfo) {
+					if util.IntAll(v["status"]) == 1 {
+						isEnt = true
+						break
+					}
+				}
+			}
+		}*/
 		//付费用户无免费订阅,不进入订阅向导页面
-		if util.IntAll((*data)["i_member_status"]) > 0 || util.IntAll((*data)["i_vip_status"]) > 0 {
+		if util.IntAll((*data)["i_member_status"]) > 0 || util.IntAll((*data)["i_vip_status"]) > 0  {
 			return false
 		}
 		o_jy, _ := (*data)["o_jy"].(map[string]interface{})
@@ -245,8 +263,6 @@ func isInTSguide(userid string) bool {
 		}
 	}
 	return false
-
-	return false
 }
 func (m *Front) Feedback() error {
 	defer util.Catch()

+ 26 - 0
src/jfw/modules/app/src/app/front/me.go

@@ -325,7 +325,9 @@ func (l *Me) MyInfo() {
 		"userType": "free",
 	}
 	userId, _ := l.GetSession("userId").(string)
+	fmt.Println("1223312",userId)
 	user, ok := mongodb.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,"o_jy":1,"i_vip_status":1,"l_vip_endtime":1,"o_vipjy":1,"i_vip_subtips":1,"i_entniche_first":1}`)
+	fmt.Println("1223312",(*user)["s_phone"].(string),(*user)["s_m_phone"].(string))
 	if ok && user != nil {
 		isExpire := -1
 		isPassCount := false
@@ -361,6 +363,30 @@ func (l *Me) MyInfo() {
 				hasKeyFlag = len(a_key) > 0
 			}
 		}
+		fmt.Println("1223312",(*user)["s_phone"].(string),(*user)["s_m_phone"].(string))
+		//商机管理处理
+		phone := ""
+		if s_phone, _ := (*user)["s_phone"].(string); s_phone != "" {
+			phone = s_phone
+		} else if s_m_phone, _ := (*user)["s_m_phone"].(string); s_m_phone != "" {
+			phone = s_m_phone
+		}
+		isEnt := false
+		if phone != "" {
+			//已购买企业未过期
+			log.Println("SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1",phone)
+			if entInfo := public.Mysql.SelectBySql(`SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len((*entInfo)) > 0 {
+				for _, v := range (*entInfo) {
+					if qutil.IntAll(v["status"]) == 1 {
+						isEnt = true
+						break
+					}
+				}
+			}
+		}
+		if isEnt {
+			r["userType"] = "entniche"
+		}
 		r["isExpire"] = isExpire
 		r["vipStatus"] = qutil.IntAll((*user)["i_vip_status"])
 		r["isPassCount"] = isPassCount

+ 1 - 1
src/jfw/modules/publicapply/src/db.json

@@ -1,7 +1,7 @@
 {
 	"mongodb": {
 		"main": {
-			"address": "192.168.3.206:27080",
+			"address": "192.168.3.128:27080",
 			"size": 5,
 			"dbName": "qfw",
 			"replSet": ""

+ 2 - 2
src/jfw/modules/publicapply/src/filter/sessionfilter.go

@@ -22,9 +22,9 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 		return true
 	}
 	session := l.App.SessionManager.Session(req, w)
-	/*session.Set("userId","61303ffcad25eb5bfe058dc5")
+	session.Set("userId","5f5b395723d21d2fb0e8a318")
 	session.Set("entUserId","171")
-	session.Set("entUserId","3602")*/
+	session.Set("entUserId","3602")
 	userId, ok := session.Get("userId").(string)
 	if !ok || userId == "" {
 		R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})

+ 23 - 1
src/jfw/modules/publicapply/src/me/me.go

@@ -2,6 +2,7 @@ package me
 
 import (
 	"db"
+	"jfw/public"
 	"qfw/util"
 	"qfw/util/jy"
 	"qfw/util/redis"
@@ -26,7 +27,7 @@ func (m *Me) MyInfo() {
 		"userType": "free",
 	}
 	userId, _ := m.GetSession("userId").(string)
-	user, ok := db.Mgo.FindById("user", userId, `{"o_jy":1,"i_vip_status":1,"l_vip_endtime":1,"o_vipjy":1,"o_member_jy":1}`)
+	user, ok := db.Mgo.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,"o_jy":1,"i_vip_status":1,"l_vip_endtime":1,"o_vipjy":1,"o_member_jy":1}`)
 	if ok && user != nil {
 		isExpire := -1
 		isPassCount := false
@@ -51,6 +52,27 @@ func (m *Me) MyInfo() {
 		} else {
 			isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 150
 		}
+		phone := ""
+		if s_phone, _ := (*user)["s_phone"].(string); s_phone != "" {
+			phone = s_phone
+		} else if s_m_phone, _ := (*user)["s_m_phone"].(string); s_m_phone != "" {
+			phone = s_m_phone
+		}
+		isEnt := false
+		if phone != "" {
+			//已购买企业未过期
+			if entInfo := public.Mysql.SelectBySql(`SELECT status FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len((*entInfo)) > 0 {
+				for _, v := range (*entInfo) {
+					if util.IntAll(v["status"]) == 1 {
+						isEnt = true
+						break
+					}
+				}
+			}
+		}
+		if isEnt {
+			r["userType"] = "entniche"
+		}
 		r["isExpire"] = isExpire
 		r["vipStatus"] = util.IntAll((*user)["i_vip_status"])
 		r["isPassCount"] = isPassCount

+ 1 - 1
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -41,7 +41,7 @@ func (this *KeyWordsSet) UpdateKeyWords() map[string]interface{} {
 		types = "o_vipjy"
 	}
 	//付费用户
-	if power.Status > 0 || power.VipStatus > 0 {
+	if power.Status > 0 || power.VipStatus > 0  {
 		switch this.ActionType {
 		case "SK": //保存/修改关键词
 			return AddKeyWords(types, this.UserId, this.ClassifyIndex, this.ClassifyName, this.KeyWordIndex, this.KeyWordName, this.KeyWordsCount, this.NotKeyWord, this.AppendKeyWord, this.MatchWay)

+ 2 - 1
src/jfw/modules/publicapply/src/subscribePush/service/pushList.go

@@ -58,7 +58,7 @@ func (sp *SubscribePush) VipSwitch() {
 			if vipMsg.EntnicheStatus <= 0 {
 				return nil, fmt.Errorf("未购买商机管理")
 			}
-			sp.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Member)
+			sp.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Entniche)
 			switchOk = true
 		} else {
 			return nil, fmt.Errorf("未知请求")
@@ -85,6 +85,7 @@ func (sp *SubscribePush) HasPushHistory() {
 		vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 	}
 	if vipType==jy.SwitchService.Entniche{
+		fmt.Println(util.IntAll(sp.GetSession("entUserId")))
 		userId = util.ObjToString(sp.GetSession("entUserId"))
 	}
 	go entity.HistoryPush.UpdateUserPushUnread(userId, vipType)