wangchuanjin 3 年之前
父节点
当前提交
490df29d20

+ 3 - 3
src/jfw/front/shorturl.go

@@ -147,7 +147,7 @@ func (s *Short) Article(stype, id string) error {
 					var retMap = make(map[string]interface{})
 					stype = "content"
 					_id := util.CommonDecodeArticle(stype, id)[0]
-					_, _, _, obj := pcVRT(_id, "")
+					_, _, _, obj := pcVRT(_id, "", true)
 					if obj != nil && len(obj) > 0 {
 						retMap["_id"] = id
 						retMap["title"], _ = obj["title"].(string)
@@ -236,7 +236,7 @@ func (s *Short) Article(stype, id string) error {
 		s.T["avatar"] = myavatar
 		s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
 		var obj map[string]interface{}
-		obj = wxvisitD(sid, userId, myopenid)
+		obj = wxvisitD(sid, userId, myopenid, isVip || isMember || isEntniche)
 		if len(obj) > 0 {
 			//获取打赏文案
 			s.T["rewardText"], s.T["advertText"] = getRewardText()
@@ -337,7 +337,7 @@ func (s *Short) Article(stype, id string) error {
 			s.T["shareid"] = se.EncodeString(shareid)
 			s.T["keywords"] = s.GetString("kds")
 			s.DisableHttpCache()
-			po, bo, wo, obj := pcVRT(sid, industry)
+			po, bo, wo, obj := pcVRT(sid, industry, isVip || isMember || isEntniche)
 			if obj != nil && len(obj) > 0 {
 				href, _ := obj["href"].(string)
 				href = strings.Replace(href, "\n", "", -1)

+ 14 - 4
src/jfw/front/swordfish.go

@@ -641,7 +641,7 @@ func (m *Front) VisitRedirect() {
 	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
 	userId, _ := m.GetSession("userId").(string)
 	var obj map[string]interface{}
-	obj = wxvisitD(sid, userId, myopenid)
+	obj = wxvisitD(sid, userId, myopenid, true)
 	if len(obj) > 0 {
 		//获取打赏文案
 		m.T["rewardText"], m.T["advertText"] = getRewardText()
@@ -653,7 +653,7 @@ func (m *Front) VisitRedirect() {
 		m.Redirect(surl)
 	}
 }
-func wxvisitD(sid, userId, openId string) (objdata map[string]interface{}) {
+func wxvisitD(sid, userId, openId string, isPayUser bool) (objdata map[string]interface{}) {
 	defer util.Catch()
 	var obj map[string]interface{}
 	if len(sid) > 5 {
@@ -669,6 +669,13 @@ func wxvisitD(sid, userId, openId string) (objdata map[string]interface{}) {
 			obj = *aobj
 		}
 		if ok && obj != nil && len(obj) >= 3 {
+			if !isPayUser && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
+				for k, _ := range obj {
+					if k != "title" && k != "area" && k != "subtype" && k != "toptype" && k != "publishtime" && k != "budget" && k != "bidamount" {
+						delete(obj, k)
+					}
+				}
+			}
 			fwt := util.ObjToString(obj["subtype"])
 			ltfd := getLowestField(fwt)
 			if ltfd != "" {
@@ -808,7 +815,7 @@ func (m *Front) PcVisitRedirect(sid string) {
 		if href != "" && !strings.HasPrefix(href, "http") {
 			href = "http://" + href
 		}
-		po, bo, wo, obj := pcVRT(sid, "")
+		po, bo, wo, obj := pcVRT(sid, "", true)
 		if obj != nil && len(obj) > 0 {
 			if len(po) > 0 {
 				m.T["projectOther"] = po
@@ -834,7 +841,7 @@ func (m *Front) PcVisitRedirect(sid string) {
 
 //pc三级页跳转
 //20170821增加查询字段s_subscopeclass
-func pcVRT(sid, industry string) (po, bo, wo []map[string]interface{}, objdata map[string]interface{}) {
+func pcVRT(sid, industry string, isPayUser bool) (po, bo, wo []map[string]interface{}, objdata map[string]interface{}) {
 	defer util.Catch()
 	var projectOther, buyerOther, winnerOther []map[string]interface{}
 	var obj map[string]interface{}
@@ -851,6 +858,9 @@ func pcVRT(sid, industry string) (po, bo, wo []map[string]interface{}, objdata m
 		}
 		//obj, ok := elastic.GetByIdField("bidding", "bidding", sid, ""), true
 		if ok && obj != nil && len(obj) > 0 {
+			if !isPayUser && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
+				delete(obj, "detail")
+			}
 			obj["_id"] = util.EncodeArticleId2ByCheck(sid)
 			var infoformat = util.IntAllDef(obj["infoformat"], 1)
 			obj["infoformat"] = infoformat

+ 1 - 1
src/jfw/modules/app/src/app/front/shorturl.go

@@ -129,7 +129,7 @@ func (s *Short) Article(stype, id string) error {
 
 	s.T["keywords"] = kds
 	var obj map[string]interface{}
-	obj = wxvisitD(sid, userId)
+	obj = wxvisitD(sid, userId, isVip || isEntniche || i_member_status > 0)
 	if len(obj) > 0 {
 		if belongUserId != "" && belongUserId != userId && util.ObjToString(obj["subtype"]) != "拟建" { //分享开打的
 			article_id := util.CommonDecodeArticle(stype, id)[0]

+ 8 - 1
src/jfw/modules/app/src/app/front/swordfish.go

@@ -580,7 +580,7 @@ func MFollow(userId, pname, pcode, title string) (bool, string) {
 	}
 	return followFlag, followId
 }
-func wxvisitD(sid, userId string) (objdata map[string]interface{}) {
+func wxvisitD(sid, userId string, isPayUser bool) (objdata map[string]interface{}) {
 	defer util.Catch()
 	var obj map[string]interface{}
 	if len(sid) > 5 {
@@ -591,6 +591,13 @@ func wxvisitD(sid, userId string) (objdata map[string]interface{}) {
 		//aobj, ok := elastic.GetByIdField("bidding", "bidding", sid, ""), true
 		obj = *aobj
 		if ok && obj != nil && len(obj) >= 3 {
+			if !isPayUser && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
+				for k, _ := range obj {
+					if k != "title" && k != "area" && k != "subtype" && k != "toptype" && k != "publishtime" && k != "budget" && k != "bidamount" {
+						delete(obj, k)
+					}
+				}
+			}
 			obj["_id"] = util.EncodeArticleId2ByCheck(sid)
 			// obj["url"] = obj["href"]
 			pt := obj["publishtime"]