Browse Source

feat:详情页缓存

wangshan 2 years ago
parent
commit
c23b7aa4f9
5 changed files with 249 additions and 239 deletions
  1. 3 2
      src/config.json
  2. 1 1
      src/db.json
  3. 38 40
      src/jfw/front/front.go
  4. 202 195
      src/jfw/front/shorturl.go
  5. 5 1
      src/jfw/front/swordfish.go

+ 3 - 2
src/config.json

@@ -44,7 +44,6 @@
     "treasurebox": "/jyTreasureBox/treasureBox?msg=3",
     "treasurebox": "/jyTreasureBox/treasureBox?msg=3",
     "vipreport": "/subscribepay/report/wxtplmsg?start=%s&end=%s&pushcount=%s&advertcode=%s",
     "vipreport": "/subscribepay/report/wxtplmsg?start=%s&end=%s&pushcount=%s&advertcode=%s",
     "viphomepage": "/front/vipsubscribe/introducePage?advertcode=%s",
     "viphomepage": "/front/vipsubscribe/introducePage?advertcode=%s",
-    "wxMerge": "/weixin/frontPage/userMerge/free/index",
     "viphomepage_new": "/jy_mobile/common/order/create/svip?type=buy",
     "viphomepage_new": "/jy_mobile/common/order/create/svip?type=buy",
     "liveAcitve": "/active/livePage/index",
     "liveAcitve": "/active/livePage/index",
     "bigMember": "/big/wx/page/landingPage",
     "bigMember": "/big/wx/page/landingPage",
@@ -428,5 +427,7 @@
     "approvecontent": true,
     "approvecontent": true,
     "projecttype": true,
     "projecttype": true,
     "approvecity": true
     "approvecity": true
-  }
+  },
+  "detailRedisByPayTimeOut": 7200,
+  "detailRedisByFreeTimeOut": 7200
 }
 }

+ 1 - 1
src/db.json

@@ -41,7 +41,7 @@
   },
   },
   "redis": {
   "redis": {
     "main":{
     "main":{
-      "address": "other=192.168.3.149:1712,sso=192.168.3.149:1713,push=192.168.3.149:1711,session=192.168.3.149:1713,recovery=192.168.3.149:1715,merge=192.168.3.206:2711,newother=192.168.3.149:1712,poly=192.168.3.149:1713,seoCache=192.168.3.149:1713"
+      "address": "other=192.168.3.149:1712,sso=192.168.3.149:1713,push=192.168.3.149:1711,session=192.168.3.149:1713,recovery=192.168.3.149:1715,merge=192.168.3.206:2711,newother=192.168.3.149:1712,poly=192.168.3.149:1713,seoCache=192.168.3.149:1713,limitation=192.168.3.149:1713"
     },
     },
     "login": {
     "login": {
       "address": "login=192.168.3.149:1712"
       "address": "login=192.168.3.149:1712"

+ 38 - 40
src/jfw/front/front.go

@@ -150,12 +150,16 @@ type Front struct {
 	getAdByCode xweb.Mapper `xweb:"/front/getAdByCode"`
 	getAdByCode xweb.Mapper `xweb:"/front/getAdByCode"`
 }
 }
 
 
-var sewx encrypt.SimpleEncrypt //微信的加密方法
-var mongodb = public.MQFW
-var urlMap map[string]interface{}
-
-var se = encrypt.SE //移到tools中
-var isIosReg = regexp.MustCompile("\\(i[^;]+;( U;)? CPU.+Mac OS X")
+var (
+	sewx                     encrypt.SimpleEncrypt //微信的加密方法
+	mongodb                  = public.MQFW
+	urlMap                   map[string]interface{}
+	se                       = encrypt.SE //移到tools中
+	isIosReg                 = regexp.MustCompile("\\(i[^;]+;( U;)? CPU.+Mac OS X")
+	redisLimitation          = "limitation"
+	detailRedisByPayTimeOut  = 7200
+	detailRedisByFreeTimeOut = 7200
+)
 
 
 func init() {
 func init() {
 	sewx = encrypt.SimpleEncrypt{Key: "topnet"}
 	sewx = encrypt.SimpleEncrypt{Key: "topnet"}
@@ -163,27 +167,28 @@ func init() {
 	xweb.AddAction(&Short{})
 	xweb.AddAction(&Short{})
 	xweb.AddAction(&OrgStructure{})
 	xweb.AddAction(&OrgStructure{})
 	urlMap = config.Sysconfig["redirect"].(map[string]interface{})
 	urlMap = config.Sysconfig["redirect"].(map[string]interface{})
+	detailRedisByPayTimeOut = util.If(util.IntAll(config.Sysconfig["detailRedisByPayTimeOut"]) > 0, util.IntAll(config.Sysconfig["detailRedisByPayTimeOut"]), detailRedisByPayTimeOut).(int)
+	detailRedisByFreeTimeOut = util.If(util.IntAll(config.Sysconfig["detailRedisByFreeTimeOut"]) > 0, util.IntAll(config.Sysconfig["detailRedisByFreeTimeOut"]), detailRedisByFreeTimeOut).(int)
 }
 }
 
 
-//前端页面加载
+// 前端页面加载
 func (this *Front) ReloadTo(href string) {
 func (this *Front) ReloadTo(href string) {
 	this.T["transfer"] = fmt.Sprintf("%s/%s", config.Sysconfig["webdomain"].(string), href)
 	this.T["transfer"] = fmt.Sprintf("%s/%s", config.Sysconfig["webdomain"].(string), href)
 	this.Render("/pc/reloadTo.html", &this.T)
 	this.Render("/pc/reloadTo.html", &this.T)
 }
 }
 
 
-//获取打赏标语
+// 获取打赏标语
 func (this *Front) RewardText() {
 func (this *Front) RewardText() {
 	rewardText, _ := getRewardText()
 	rewardText, _ := getRewardText()
 	this.Write(rewardText)
 	this.Write(rewardText)
 	return
 	return
 }
 }
 
 
-//
 func (f *Front) Hp() error {
 func (f *Front) Hp() error {
 	return f.Redirect("/")
 	return f.Redirect("/")
 }
 }
 
 
-//二维码图片
+// 二维码图片
 func (f *Front) Qr() error {
 func (f *Front) Qr() error {
 	w := f.ResponseWriter
 	w := f.ResponseWriter
 	w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
 	w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
@@ -196,7 +201,7 @@ func (f *Front) Qr() error {
 	return err
 	return err
 }
 }
 
 
-//二维码图片
+// 二维码图片
 func (f *Front) Hpshare() error {
 func (f *Front) Hpshare() error {
 	w := f.ResponseWriter
 	w := f.ResponseWriter
 	w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
 	w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
@@ -237,7 +242,6 @@ func (p *Front) PayIndex() error {
 	return p.Render("/weixin/pay.html", &p.T)
 	return p.Render("/weixin/pay.html", &p.T)
 }
 }
 
 
-//
 func (f *Front) RecInof() error {
 func (f *Front) RecInof() error {
 	var msg = ""
 	var msg = ""
 	var flag = true
 	var flag = true
@@ -360,7 +364,7 @@ func (f *Front) RecInof() error {
 	return nil
 	return nil
 }
 }
 
 
-//更新取到的权重最低的字段到bidding表
+// 更新取到的权重最低的字段到bidding表
 func updateLastWrongField(id, result string) {
 func updateLastWrongField(id, result string) {
 	if result == "" {
 	if result == "" {
 		return
 		return
@@ -372,7 +376,7 @@ func updateLastWrongField(id, result string) {
 	})
 	})
 }
 }
 
 
-//轮询查登录状态
+// 轮询查登录状态
 func (f *Front) AjaxPolling() {
 func (f *Front) AjaxPolling() {
 	reqType, _ := f.GetInteger("reqType")
 	reqType, _ := f.GetInteger("reqType")
 	if reqType == 1 {
 	if reqType == 1 {
@@ -419,7 +423,7 @@ func (f *Front) AjaxPolling() {
 	}
 	}
 }
 }
 
 
-//广告服务
+// 广告服务
 func (f *Front) Advservices() error {
 func (f *Front) Advservices() error {
 	var shareid = f.GetString("id")
 	var shareid = f.GetString("id")
 	if len(shareid) == 0 {
 	if len(shareid) == 0 {
@@ -430,12 +434,12 @@ func (f *Front) Advservices() error {
 	return f.Render("/pc/advservices.html", &f.T)
 	return f.Render("/pc/advservices.html", &f.T)
 }
 }
 
 
-//移动端专题推广
+// 移动端专题推广
 func (f *Front) Mobtopics() error {
 func (f *Front) Mobtopics() error {
 	return f.Render("/active/mobtopics.html")
 	return f.Render("/active/mobtopics.html")
 }
 }
 
 
-//移动端专题推广
+// 移动端专题推广
 func (f *Front) Extension(page string) error {
 func (f *Front) Extension(page string) error {
 	//今日头条和百度推广用的同一个页面,如以后有变动,需拆分成两个。
 	//今日头条和百度推广用的同一个页面,如以后有变动,需拆分成两个。
 	if page != "tengxun" {
 	if page != "tengxun" {
@@ -444,7 +448,7 @@ func (f *Front) Extension(page string) error {
 	return f.Render("/active/ext-" + page + ".html")
 	return f.Render("/active/ext-" + page + ".html")
 }
 }
 
 
-//SEM推广
+// SEM推广
 func (f *Front) Topics() error {
 func (f *Front) Topics() error {
 	f.T["logid"] = config.Seoconfig["jySEMtgy"].(string)
 	f.T["logid"] = config.Seoconfig["jySEMtgy"].(string)
 	userId, _ := f.GetSession("userId").(string)
 	userId, _ := f.GetSession("userId").(string)
@@ -485,7 +489,6 @@ func (f *Front) Topics() error {
 	return f.Render("/pc/landingpage.html", &f.T)
 	return f.Render("/pc/landingpage.html", &f.T)
 }
 }
 
 
-//
 func (f *Front) Notin() error {
 func (f *Front) Notin() error {
 	refer := "/"
 	refer := "/"
 	tmp := f.Header("Referer")
 	tmp := f.Header("Referer")
@@ -507,7 +510,6 @@ func (f *Front) Notin() error {
 	return f.Render("/pc/notin.html", &f.T)
 	return f.Render("/pc/notin.html", &f.T)
 }
 }
 
 
-//
 func (f *Front) Followinfo() error {
 func (f *Front) Followinfo() error {
 	var pid = f.GetString("pid")
 	var pid = f.GetString("pid")
 	var kid = f.GetString("kid")
 	var kid = f.GetString("kid")
@@ -592,7 +594,6 @@ func (f *Front) Followinfo() error {
 	return nil
 	return nil
 }
 }
 
 
-//
 func (f *Front) Login(key string) error {
 func (f *Front) Login(key string) error {
 	shareid := se.DecodeString(key)
 	shareid := se.DecodeString(key)
 	openid := redis.GetStr("sso", "p_usershare_"+shareid)
 	openid := redis.GetStr("sso", "p_usershare_"+shareid)
@@ -615,7 +616,7 @@ func (f *Front) Login(key string) error {
 	return nil
 	return nil
 }
 }
 
 
-//用户是否登录
+// 用户是否登录
 func (f *Front) HasSign() error {
 func (f *Front) HasSign() error {
 	sessVal := f.Session().GetMultiple()
 	sessVal := f.Session().GetMultiple()
 	if userId, _ := sessVal["mgoUserId"].(string); userId != "" {
 	if userId, _ := sessVal["mgoUserId"].(string); userId != "" {
@@ -690,7 +691,7 @@ func (f *Front) GetLoginNum(prestr string) error {
 	return nil
 	return nil
 }
 }
 
 
-//一键报告
+// 一键报告
 func (m *Front) Onekey() error {
 func (m *Front) Onekey() error {
 	defer util.Catch()
 	defer util.Catch()
 	fkid := encrypt.DecodeArticleId2ByCheck(m.GetString("fkid"))[0]
 	fkid := encrypt.DecodeArticleId2ByCheck(m.GetString("fkid"))[0]
@@ -756,7 +757,6 @@ func (m *Front) Onekey() error {
 	return nil
 	return nil
 }
 }
 
 
-//
 func (m *Front) Encrypt() error {
 func (m *Front) Encrypt() error {
 	defer util.Catch()
 	defer util.Catch()
 	id := m.GetString("id")
 	id := m.GetString("id")
@@ -779,12 +779,11 @@ func (m *Front) Encrypt() error {
 	return nil
 	return nil
 }
 }
 
 
-//
 func (m *Front) Wxerr() error {
 func (m *Front) Wxerr() error {
 	return m.Render("/_err.html")
 	return m.Render("/_err.html")
 }
 }
 
 
-//查找用户并创建session
+// 查找用户并创建session
 func FindUserAndCreateSess(openid string, sess *httpsession.Session, typ string, flag, isSwitchToBestIdentity bool) (bool, *map[string]interface{}, map[string]interface{}) {
 func FindUserAndCreateSess(openid string, sess *httpsession.Session, typ string, flag, isSwitchToBestIdentity bool) (bool, *map[string]interface{}, map[string]interface{}) {
 	return CreateSession(map[string]interface{}{
 	return CreateSession(map[string]interface{}{
 		"s_m_openid": openid,
 		"s_m_openid": openid,
@@ -848,7 +847,7 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
 
 
 var bindUrl = "/front/account/phone/bind?mode=mergeBind"
 var bindUrl = "/front/account/phone/bind?mode=mergeBind"
 
 
-//微信跳转创建session
+// 微信跳转创建session
 func (m *Front) Sess(ostr string) error {
 func (m *Front) Sess(ostr string) error {
 	defer util.Catch()
 	defer util.Catch()
 	if strings.Contains(ostr, "&") {
 	if strings.Contains(ostr, "&") {
@@ -966,7 +965,7 @@ func (m *Front) Sess(ostr string) error {
 	return nil
 	return nil
 }
 }
 
 
-//删除模板缓存
+// 删除模板缓存
 func (d *Front) Delc(url string) {
 func (d *Front) Delc(url string) {
 	defer util.Catch()
 	defer util.Catch()
 	d.App.TemplateMgr.CacheDelete(strings.Replace(url, "GG", "/", 1))
 	d.App.TemplateMgr.CacheDelete(strings.Replace(url, "GG", "/", 1))
@@ -977,12 +976,12 @@ func (m *Front) Viewdemo() {
 	m.Redirect("/swordfish/guide/-1")
 	m.Redirect("/swordfish/guide/-1")
 }
 }
 
 
-//剑鱼标讯用户协议
+// 剑鱼标讯用户协议
 func (m *Front) Wxprotocol() error {
 func (m *Front) Wxprotocol() error {
 	return m.Render("/weixin/wxprotocol.html")
 	return m.Render("/weixin/wxprotocol.html")
 }
 }
 
 
-//推送列表
+// 推送列表
 func (m *Front) WxpushListInfo(_id string) error {
 func (m *Front) WxpushListInfo(_id string) error {
 	return m.Redirect("/swordfish/historypush")
 	return m.Redirect("/swordfish/historypush")
 }
 }
@@ -1062,7 +1061,7 @@ func (m *Front) Isrecord(name string) {
 	}
 	}
 }
 }
 
 
-//招标订阅向导
+// 招标订阅向导
 func (f *Front) TSGuide() error {
 func (f *Front) TSGuide() error {
 	defer util.Catch()
 	defer util.Catch()
 	userid := util.ObjToString(f.GetSession("userId"))
 	userid := util.ObjToString(f.GetSession("userId"))
@@ -1165,12 +1164,12 @@ func isInTSguide(userid string) bool {
 	return false
 	return false
 }
 }
 
 
-//查看原文中转
+// 查看原文中转
 func (f *Front) Transfer() error {
 func (f *Front) Transfer() error {
 	return f.Redirect(f.GetString("url"))
 	return f.Redirect(f.GetString("url"))
 }
 }
 
 
-//关于我们
+// 关于我们
 func (f *Front) Aboutus() error {
 func (f *Front) Aboutus() error {
 	code := f.GetString("code")
 	code := f.GetString("code")
 	if mobileReg.MatchString(f.UserAgent()) {
 	if mobileReg.MatchString(f.UserAgent()) {
@@ -1188,7 +1187,7 @@ func (f *Front) Aboutus() error {
 	return f.SetBody(content)
 	return f.SetBody(content)
 }
 }
 
 
-//商务合作
+// 商务合作
 func (f *Front) Busicooperation() error {
 func (f *Front) Busicooperation() error {
 	var shareid = f.GetString("id")
 	var shareid = f.GetString("id")
 	if len(shareid) == 0 {
 	if len(shareid) == 0 {
@@ -1218,7 +1217,7 @@ func (f *Front) Gethotkey() error {
 	return nil
 	return nil
 }
 }
 
 
-//redis存储用户搜索关键词 企业 项目信息
+// redis存储用户搜索关键词 企业 项目信息
 func (f *Front) Rediskw() error {
 func (f *Front) Rediskw() error {
 	skw := f.GetString("skw")
 	skw := f.GetString("skw")
 	num := f.GetString("num")
 	num := f.GetString("num")
@@ -1285,7 +1284,7 @@ func (f *Front) DownloadJyApp() error {
 	return f.Redirect(getDownloadUri(code, source, domain+apkurl))
 	return f.Redirect(getDownloadUri(code, source, domain+apkurl))
 }
 }
 
 
-//获取app下载地址,不通code对应不通渠道的app包
+// 获取app下载地址,不通code对应不通渠道的app包
 func getDownloadUri(code, source, download string) string {
 func getDownloadUri(code, source, download string) string {
 	jyapp := config.Sysconfig["jyapp"].(map[string]interface{})
 	jyapp := config.Sysconfig["jyapp"].(map[string]interface{})
 	channelMap := jyapp["channelDir"].(map[string]interface{})
 	channelMap := jyapp["channelDir"].(map[string]interface{})
@@ -1377,7 +1376,7 @@ func (f *Front) LimitSearchText() {
 	f.Write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">" + fmt.Sprintf(public.Lst.Msg, status, public.Lst.Count, public.Lst.TimeOut, public.Lst.TotalPage))
 	f.Write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">" + fmt.Sprintf(public.Lst.Msg, status, public.Lst.Count, public.Lst.TimeOut, public.Lst.TotalPage))
 }
 }
 
 
-//设置js css 版本号,修改以后记得同步更新seo.json中的值
+// 设置js css 版本号,修改以后记得同步更新seo.json中的值
 func (f *Front) SetSeoVersion() {
 func (f *Front) SetSeoVersion() {
 	//!@111qqq@! md5=51a3b7b4ed3cf140
 	//!@111qqq@! md5=51a3b7b4ed3cf140
 	if f.GetString("p") != "51a3b7b4ed3cf140" {
 	if f.GetString("p") != "51a3b7b4ed3cf140" {
@@ -1505,7 +1504,6 @@ func (f *Front) YmResult() error {
 
 
 }
 }
 
 
-//
 func (f *Front) JylabShareTimeline() {
 func (f *Front) JylabShareTimeline() {
 	userid := util.ObjToString(f.GetSession("userId"))
 	userid := util.ObjToString(f.GetSession("userId"))
 	if userid == "" {
 	if userid == "" {
@@ -1531,7 +1529,8 @@ func (f *Front) JylabShareTimeline() {
 	}
 	}
 }
 }
 
 
-/**
+/*
+*
 成功分享后 更改分享相关信息
 成功分享后 更改分享相关信息
 
 
 shareType - 分享类型 1-详情页 2-推送列表 3-实验室
 shareType - 分享类型 1-详情页 2-推送列表 3-实验室
@@ -1616,7 +1615,6 @@ func encodeURIComponent(str string) string {
 	return r
 	return r
 }
 }
 
 
-//
 func (f *Front) GetAdByCode() {
 func (f *Front) GetAdByCode() {
 	m := map[string]interface{}{}
 	m := map[string]interface{}{}
 	if ad_name := f.GetString("ad_name"); ad_name != "" {
 	if ad_name := f.GetString("ad_name"); ad_name != "" {

+ 202 - 195
src/jfw/front/shorturl.go

@@ -202,7 +202,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 			return nil
 			return nil
 		}
 		}
 		catchKey := fmt.Sprintf("jypcdetail_%s_%s_%s", userId, stype, sid)
 		catchKey := fmt.Sprintf("jypcdetail_%s_%s_%s", userId, stype, sid)
-		if res := redis.Get("newother", catchKey); res == nil || res == "" {
+		if res := redis.Get(redisLimitation, catchKey); res == nil || res == "" {
 			industry := s.GetString("industry")
 			industry := s.GetString("industry")
 			var shareid = s.GetString("id")
 			var shareid = s.GetString("id")
 			if len(shareid) == 0 {
 			if len(shareid) == 0 {
@@ -265,7 +265,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 				obj["description"] = DescriptionHandle(stype, obj)
 				obj["description"] = DescriptionHandle(stype, obj)
 				s.T["obj"] = obj
 				s.T["obj"] = obj
 				content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
 				content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
-				redis.Put("newother", catchKey, string(content), 60*20)
+				redis.Put(redisLimitation, catchKey, string(content), 60*20)
 				return s.SetBody(content)
 				return s.SetBody(content)
 			}
 			}
 		} else {
 		} else {
@@ -296,6 +296,8 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 		isEntniche    bool = userPower.EntnicheStatus > 0                                                 //商机管理
 		isEntniche    bool = userPower.EntnicheStatus > 0                                                 //商机管理
 		privatedata   bool = userPower.PrivateGD                                                          //广东移动DICT 用户
 		privatedata   bool = userPower.PrivateGD                                                          //广东移动DICT 用户
 		isEntService  bool = userPower.Data.Ent.PowerSource > 0 && userPower.Data.Entniche.IsEntPower > 0 //商机管理服务
 		isEntService  bool = userPower.Data.Ent.PowerSource > 0 && userPower.Data.Entniche.IsEntPower > 0 //商机管理服务
+		isPay              = isVip || isMember || isEntniche
+		newCanRead         = false
 	)
 	)
 	if res != nil && len(*res) > 0 {
 	if res != nil && len(*res) > 0 {
 		if isVip && util.Int64All((*res)["l_vip_starttime"]) < util.Int64All(config.Sysconfig["contextOldVipLimit"]) {
 		if isVip && util.Int64All((*res)["l_vip_starttime"]) < util.Int64All(config.Sysconfig["contextOldVipLimit"]) {
@@ -319,6 +321,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 	s.T["isEntniche"] = isEntniche
 	s.T["isEntniche"] = isEntniche
 	s.T["isEntnicheNew"] = isEntnicheNew
 	s.T["isEntnicheNew"] = isEntnicheNew
 	s.T["isEntService"] = isEntService
 	s.T["isEntService"] = isEntService
+
 	if bm {
 	if bm {
 		//判断有没有取关,取关的话,跳转到关于剑鱼标讯页面
 		//判断有没有取关,取关的话,跳转到关于剑鱼标讯页面
 		if ssOpenid != nil && ssOpenid != "" {
 		if ssOpenid != nil && ssOpenid != "" {
@@ -344,6 +347,18 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 			shareopenid, sid = SwiDef(sid_openid)
 			shareopenid, sid = SwiDef(sid_openid)
 		}
 		}
 
 
+		if stype == "advancedProject" {
+			//判断此用户是否有打开的权限
+			newUserId := s.GetSession("base_user_id")
+			pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
+			//访问次数加1
+			if pushData == nil {
+				newCanRead = false
+			} else {
+				public.BaseMysql.UpdateOrDeleteBySql("UPDATE leadproject_push SET  visit_count=visit_count+1 ,lastvisit_time=? WHERE id = ?", time.Now().Format("2006-01-02 15:04:05"), (*pushData)["id"])
+				newCanRead = true
+			}
+		}
 		s.T["keywords"] = kds
 		s.T["keywords"] = kds
 		if shareopenid != "" {
 		if shareopenid != "" {
 			s.T["shareopenid"] = shareopenid
 			s.T["shareopenid"] = shareopenid
@@ -360,7 +375,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 		s.T["nickname"] = mynickname
 		s.T["nickname"] = mynickname
 		s.T["avatar"] = myavatar
 		s.T["avatar"] = myavatar
 		s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
 		s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
-		obj := wxvisitD(sid, userId, myopenid, stype, (isVip && isOldVip) || isMember || isEntniche)
+		obj := wxvisitD(sid, userId, myopenid, stype, (isVip && isOldVip) || isMember || isEntniche || newCanRead)
 		canRead := false
 		canRead := false
 		if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
 		if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
 			((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) || //新超级订阅非采购意向”和“拟建项目”
 			((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) || //新超级订阅非采购意向”和“拟建项目”
@@ -369,22 +384,8 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 		} else {
 		} else {
 			canRead = SeeDetailLimit(obj, userId, sid)
 			canRead = SeeDetailLimit(obj, userId, sid)
 		}
 		}
-		if stype == "advancedProject" {
-			newCanRead := false
-			//判断此用户是否有打开的权限
-			newUserId := s.GetSession("base_user_id")
-			pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
-			//访问次数加1
-			if pushData == nil {
-				newCanRead = false
-			} else {
-				public.BaseMysql.UpdateOrDeleteBySql("UPDATE leadproject_push SET  visit_count=visit_count+1 ,lastvisit_time=? WHERE id = ?", time.Now().Format("2006-01-02 15:04:05"), (*pushData)["id"])
-				newCanRead = true
-			}
-			if newCanRead || canRead {
-				obj = wxvisitD(sid, userId, myopenid, stype, true)
-				canRead = true
-			}
+		if newCanRead {
+			canRead = newCanRead
 			s.T["canRead"] = canRead
 			s.T["canRead"] = canRead
 		}
 		}
 		if len(obj) > 0 {
 		if len(obj) > 0 {
@@ -476,138 +477,144 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 		if userId != "" && stype == "indexcontent" { //已登录用户直接跳转至正常三级页
 		if userId != "" && stype == "indexcontent" { //已登录用户直接跳转至正常三级页
 			return s.Redirect(fmt.Sprintf("/article/content/%s.html", encrypt.CommonEncodeArticle("content", sid)))
 			return s.Redirect(fmt.Sprintf("/article/content/%s.html", encrypt.CommonEncodeArticle("content", sid)))
 		}
 		}
-		industry := s.GetString("industry")
-		var shareid = s.GetString("id")
-		if len(shareid) == 0 {
-			shareid = "10"
-		}
-		s.T["logid"] = config.Seoconfig["jysskzy"].(string)
-		s.T["shareid"] = se.EncodeString(shareid)
-		s.T["keywords"] = s.GetString("kds")
-		s.DisableHttpCache()
-		po, bo, wo, obj := pcVRT(sid, industry, stype, isVip || isMember || isEntniche)
-		if obj != nil && len(obj) > 0 {
-			var node bool
-			if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
-				((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) || //新超级订阅非采购意向”和“拟建项目”
-				stype == "mailprivate" || stype == "indexcontent" || stype == "bdprivate" { //邮箱推送
-				node = true
+		if stype == "advancedProject" {
+			//判断此用户是否有打开的权限
+			newUserId := s.GetSession("base_user_id")
+			pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
+			//访问次数加1
+			if pushData == nil {
+				newCanRead = false
 			} else {
 			} else {
-				//_, _, _, objc := pcVRT(sid, indust, stype, isVip || isMember || isEntniche)
-				node = SeeDetailLimit(obj, userId, sid)
+				public.BaseMysql.UpdateOrDeleteBySql("UPDATE leadproject_push SET  visit_count=visit_count+1 ,lastvisit_time=? WHERE id = ?", time.Now().Format("2006-01-02 15:04:05"), (*pushData)["id"])
+				newCanRead = true
 			}
 			}
-
-			if obj["publishtime"] != nil {
-				obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["publishtime"]), 0).Format(date.Date_Short_Layout)
+		}
+		var detailKey = util.If(isPay || newCanRead, "pay", "free")
+		catchKey := fmt.Sprintf("jypcdetail_%s_%s_%s", detailKey, stype, sid)
+		if res := redis.Get(redisLimitation, catchKey); res == nil || res == "" {
+			redisTimeOut := util.If(isPay || newCanRead, detailRedisByPayTimeOut, detailRedisByFreeTimeOut).(int)
+			industry := s.GetString("industry")
+			var shareid = s.GetString("id")
+			if len(shareid) == 0 {
+				shareid = "10"
 			}
 			}
-			s.T["canRead"] = node
-			if stype == "advancedProject" {
-				canRead := false
-				//判断此用户是否有打开的权限
-				newUserId := s.GetSession("base_user_id")
-				pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
-				//访问次数加1
-				if pushData == nil {
-					canRead = false
+			s.T["logid"] = config.Seoconfig["jysskzy"].(string)
+			s.T["shareid"] = se.EncodeString(shareid)
+			s.T["keywords"] = s.GetString("kds")
+			s.DisableHttpCache()
+			po, bo, wo, obj := pcVRT(sid, industry, stype, isVip || isMember || isEntniche || newCanRead)
+			if obj != nil && len(obj) > 0 {
+				var node bool
+				if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
+					((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) || //新超级订阅非采购意向”和“拟建项目”
+					stype == "mailprivate" || stype == "indexcontent" || stype == "bdprivate" { //邮箱推送
+					node = true
 				} else {
 				} else {
-					public.BaseMysql.UpdateOrDeleteBySql("UPDATE leadproject_push SET  visit_count=visit_count+1 ,lastvisit_time=? WHERE id = ?", time.Now().Format("2006-01-02 15:04:05"), (*pushData)["id"])
-					canRead = true
-				}
-				if canRead || node {
-					_, _, _, obj = pcVRT(sid, industry, stype, true)
-					canRead = true
-					node = canRead
+					//_, _, _, objc := pcVRT(sid, indust, stype, isVip || isMember || isEntniche)
+					node = SeeDetailLimit(obj, userId, sid)
 				}
 				}
-				s.T["canRead"] = canRead
-			}
-			if node || util.ObjToString(obj["subtype"]) == "拟建" {
-				if len(po) > 0 {
-					s.T["projectOther"] = po
-				}
-				if len(bo) > 0 {
-					s.T["buyerOther"] = bo
+
+				if obj["publishtime"] != nil {
+					obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["publishtime"]), 0).Format(date.Date_Short_Layout)
 				}
 				}
-				if len(wo) > 0 {
-					s.T["winnerOther"] = wo
+				s.T["canRead"] = node
+				if newCanRead {
+					s.T["canRead"] = newCanRead
 				}
 				}
-				//判断时间 //如果是seo页面超过时间访问的进入首页
-				comeinTime := time.Unix(util.Int64All(obj["comeintime"]), 0)
-				if stype == "indexcontent" {
-					if count := public.MQFW.Count("seobidding", map[string]interface{}{"bid": sid}); count <= 0 && comeinTime.Before(time.Now().Add(time.Duration(-util.IntAll(config.Sysconfig["seoBeforeTimeHour"]))*time.Hour)) {
-						return s.Redirect("/")
+				if node || util.ObjToString(obj["subtype"]) == "拟建" {
+					if len(po) > 0 {
+						s.T["projectOther"] = po
 					}
 					}
-				}
-				FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, false)
-				//免费用户正文手机号替换
-				if obj["site"] == "剑鱼信息发布平台" && !isMember {
-					//采购电话中标单位电话置空
-					if util.InterfaceToStr(obj["buyertel"]) != "" {
-						obj["buyertel"] = "freeView"
+					if len(bo) > 0 {
+						s.T["buyerOther"] = bo
 					}
 					}
-					if util.InterfaceToStr(obj["winnertel"]) != "" {
-						obj["winnertel"] = "freeView"
+					if len(wo) > 0 {
+						s.T["winnerOther"] = wo
 					}
 					}
-					//正文电话 手机号 邮箱处理
-					if detail, _ := obj["detail"].(string); detail != "" {
-						//手机号
-						re1 := regexp.MustCompile("1[345789]{1}\\d{9}")
-						detail1 := re1.ReplaceAllString(detail, `<span class="freeView">点击查看</span>`)
-						code := util.InterfaceToStr(obj["projectcode"])
-						if code != "" {
-							detail1 = strings.ReplaceAll(detail1, code, "*********")
+					//判断时间 //如果是seo页面超过时间访问的进入首页
+					comeinTime := time.Unix(util.Int64All(obj["comeintime"]), 0)
+					if stype == "indexcontent" {
+						if count := public.MQFW.Count("seobidding", map[string]interface{}{"bid": sid}); count <= 0 && comeinTime.Before(time.Now().Add(time.Duration(-util.IntAll(config.Sysconfig["seoBeforeTimeHour"]))*time.Hour)) {
+							return s.Redirect("/")
 						}
 						}
-						//座机
-						re2 := regexp.MustCompile("((0\\d{2,3})-)(\\d{7,8})(-(\\d{3,}))?")
-						detail2 := re2.ReplaceAllString(detail1, `<span class="freeView">点击查看</span>`)
-						re4 := regexp.MustCompile("((400)-)(\\d{3,4}-)(\\d{3,})")
-						detail4 := re4.ReplaceAllString(detail2, `<span class="freeView">点击查看</span>`)
-						//邮箱
-						re3 := regexp.MustCompile("([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)")
-						detail3 := re3.ReplaceAllString(detail4, `<span class="freeView">点击查看</span>`)
-						obj["detail"] = strings.ReplaceAll(strings.ReplaceAll(detail3, `<span class="freeView">点击查看</span><span class="freeView">点击查看</span>`, `<span class="freeView">点击查看</span>`), "*********", code)
 					}
 					}
-				}
-				if obj["projectname"] != nil {
-					s.SetSession("projectname", obj["projectname"])
-				}
+					FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, false)
+					//免费用户正文手机号替换
+					if obj["site"] == "剑鱼信息发布平台" && !isMember {
+						//采购电话中标单位电话置空
+						if util.InterfaceToStr(obj["buyertel"]) != "" {
+							obj["buyertel"] = "freeView"
+						}
+						if util.InterfaceToStr(obj["winnertel"]) != "" {
+							obj["winnertel"] = "freeView"
+						}
+						//正文电话 手机号 邮箱处理
+						if detail, _ := obj["detail"].(string); detail != "" {
+							//手机号
+							re1 := regexp.MustCompile("1[345789]{1}\\d{9}")
+							detail1 := re1.ReplaceAllString(detail, `<span class="freeView">点击查看</span>`)
+							code := util.InterfaceToStr(obj["projectcode"])
+							if code != "" {
+								detail1 = strings.ReplaceAll(detail1, code, "*********")
+							}
+							//座机
+							re2 := regexp.MustCompile("((0\\d{2,3})-)(\\d{7,8})(-(\\d{3,}))?")
+							detail2 := re2.ReplaceAllString(detail1, `<span class="freeView">点击查看</span>`)
+							re4 := regexp.MustCompile("((400)-)(\\d{3,4}-)(\\d{3,})")
+							detail4 := re4.ReplaceAllString(detail2, `<span class="freeView">点击查看</span>`)
+							//邮箱
+							re3 := regexp.MustCompile("([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)")
+							detail3 := re3.ReplaceAllString(detail4, `<span class="freeView">点击查看</span>`)
+							obj["detail"] = strings.ReplaceAll(strings.ReplaceAll(detail3, `<span class="freeView">点击查看</span><span class="freeView">点击查看</span>`, `<span class="freeView">点击查看</span>`), "*********", code)
+						}
+					}
+					if obj["projectname"] != nil {
+						s.SetSession("projectname", obj["projectname"])
+					}
 
 
-				if obj["entidlist"] != nil { //大会员中标企业跳转至画像
-					s_winner := util.ObjToString(obj["s_winner"])
-					idObjs, _ := obj["entidlist"].([]interface{})
-					winnerIdArr := []string{}
-					for _, v := range strings.Split(s_winner, ",") {
-						if v == "-" || !isInStringArr(util.ObjArrToStringArr(idObjs), v) {
-							continue
+					if obj["entidlist"] != nil { //大会员中标企业跳转至画像
+						s_winner := util.ObjToString(obj["s_winner"])
+						idObjs, _ := obj["entidlist"].([]interface{})
+						winnerIdArr := []string{}
+						for _, v := range strings.Split(s_winner, ",") {
+							if v == "-" || !isInStringArr(util.ObjArrToStringArr(idObjs), v) {
+								continue
+							}
+							winnerIdArr = append(winnerIdArr, encrypt.EncodeArticleId2ByCheck(v))
+							obj["entIds"] = winnerIdArr
 						}
 						}
-						winnerIdArr = append(winnerIdArr, encrypt.EncodeArticleId2ByCheck(v))
-						obj["entIds"] = winnerIdArr
+					}
+					if !node {
+						//打码遮罩
+						//s.T["canRead"] = true
+						otherFilter(obj, userId != "")
+					}
+				} else {
+					obj = map[string]interface{}{
+						"title":    obj["title"],
+						"_id":      obj["_id"],
+						"subtype":  obj["subtype"],
+						"stypeadd": obj["stypeadd"],
 					}
 					}
 				}
 				}
-				if !node {
-					//打码遮罩
-					//s.T["canRead"] = true
-					otherFilter(obj, userId != "")
-				}
-			} else {
-				obj = map[string]interface{}{
-					"title":    obj["title"],
-					"_id":      obj["_id"],
-					"subtype":  obj["subtype"],
-					"stypeadd": obj["stypeadd"],
+
+				obj["urlpath"] = s.Uri()
+				obj["industry"] = industry
+				if ssOpenid != nil {
+					obj["ucbsId"] = encrypt.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
 				}
 				}
-			}
+				obj["keywords"] = KeyWordHandle(obj)
+				obj["description"] = DescriptionHandle(stype, obj)
+				s.T["obj"] = obj
+				s.T["url"] = s.Uri()
 
 
-			obj["urlpath"] = s.Uri()
-			obj["industry"] = industry
-			if ssOpenid != nil {
-				obj["ucbsId"] = encrypt.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
+				content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
+				redis.Put(redisLimitation, catchKey, string(content), redisTimeOut)
+				return s.SetBody(content)
+				//return s.Render("/pc/biddetail_rec.html", &s.T)
 			}
 			}
-			obj["keywords"] = KeyWordHandle(obj)
-			obj["description"] = DescriptionHandle(stype, obj)
-			s.T["obj"] = obj
-			s.T["url"] = s.Uri()
-			return s.Render("/pc/biddetail_rec.html", &s.T)
-
+		} else {
+			return s.SetBody([]byte(res.(string)))
 		}
 		}
 	}
 	}
 	return nil
 	return nil
@@ -671,7 +678,7 @@ func SeeDetailLimit(obj map[string]interface{}, userId, sid string) bool {
 			return true
 			return true
 		}
 		}
 
 
-		if seeRes := redis.Get("other", watchKey); seeRes != nil && seeRes != "" {
+		if seeRes := redis.Get(redisLimitation, watchKey); seeRes != nil && seeRes != "" {
 			if resVal, _ := seeRes.(string); resVal != "" {
 			if resVal, _ := seeRes.(string); resVal != "" {
 				sidss := strings.Split(resVal, "_")
 				sidss := strings.Split(resVal, "_")
 				canRead := config.Sysconfig["canReadNotice"]
 				canRead := config.Sysconfig["canReadNotice"]
@@ -679,7 +686,7 @@ func SeeDetailLimit(obj map[string]interface{}, userId, sid string) bool {
 					sidss = append(sidss, sid)
 					sidss = append(sidss, sid)
 					arrs := RemoveDuplicatesAndEmpty(sidss)
 					arrs := RemoveDuplicatesAndEmpty(sidss)
 					newVal := strings.Join(arrs, "_")
 					newVal := strings.Join(arrs, "_")
-					redis.Put("other", watchKey, newVal, jy.GetExpire())
+					redis.Put(redisLimitation, watchKey, newVal, jy.GetExpire())
 					return true
 					return true
 				} else {
 				} else {
 					for _, v := range sidss {
 					for _, v := range sidss {
@@ -691,7 +698,7 @@ func SeeDetailLimit(obj map[string]interface{}, userId, sid string) bool {
 				}
 				}
 			}
 			}
 		} else {
 		} else {
-			redis.Put("other", watchKey, sid, jy.GetExpire())
+			redis.Put(redisLimitation, watchKey, sid, jy.GetExpire())
 			return true
 			return true
 		}
 		}
 	}
 	}
@@ -793,8 +800,8 @@ func FieldProcessing(obj map[string]interface{}, ssOpenid interface{}, industry,
 	if b && from_userid != "" && se.Decode4Hex(from_userid) != "" && se.Decode4Hex(from_userid) != userId && util.ObjToString(obj["subtype"]) != "拟建" { //分享开打的
 	if b && from_userid != "" && se.Decode4Hex(from_userid) != "" && se.Decode4Hex(from_userid) != userId && util.ObjToString(obj["subtype"]) != "拟建" { //分享开打的
 		article_id := encrypt.CommonDecodeArticle(stype, id)[0]
 		article_id := encrypt.CommonDecodeArticle(stype, id)[0]
 		key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, from_userid, userId)
 		key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, from_userid, userId)
-		if redis.Incr("other", key) == 1 {
-			redis.SetExpire("other", key, 60*60*24)
+		if redis.Incr(redisLimitation, key) == 1 {
+			redis.SetExpire(redisLimitation, key, 60*60*24)
 			err := jy.Publish(public.Mgo_Log, config.Sysconfig["nsq"].(string), config.Sysconfig["nsq_topic"].(string), jy.Jyweb_article_open, se.Decode4Hex(from_userid), jy.Jywx_node1)
 			err := jy.Publish(public.Mgo_Log, config.Sysconfig["nsq"].(string), config.Sysconfig["nsq_topic"].(string), jy.Jyweb_article_open, se.Decode4Hex(from_userid), jy.Jywx_node1)
 			if err != nil {
 			if err != nil {
 				log.Println("nsq队列写入失败-->", jy.Jyweb_article_open, se.Decode4Hex(from_userid))
 				log.Println("nsq队列写入失败-->", jy.Jyweb_article_open, se.Decode4Hex(from_userid))
@@ -806,7 +813,7 @@ func FieldProcessing(obj map[string]interface{}, ssOpenid interface{}, industry,
 // disWord 为空时处理
 // disWord 为空时处理
 func disWordNil(disWord, userId string) string {
 func disWordNil(disWord, userId string) string {
 	var from_userid string
 	var from_userid string
-	redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
+	redisDis := redis.GetStr(redisLimitation, "DIS_"+disWord[1:])
 	if redisDis != "" {
 	if redisDis != "" {
 		suffix := disWord[len(disWord)-3:]
 		suffix := disWord[len(disWord)-3:]
 		//公告三级页处理
 		//公告三级页处理
@@ -1157,66 +1164,66 @@ func (s *Short) NologinArticle(stype, id string) error {
 func (s *Short) NologinCommon(userId, stype, id, sid string) error {
 func (s *Short) NologinCommon(userId, stype, id, sid string) error {
 	tg := &Tags{}
 	tg := &Tags{}
 	catchKey := fmt.Sprintf("jypcdetail_nologin_%s_%s", stype, sid)
 	catchKey := fmt.Sprintf("jypcdetail_nologin_%s_%s", stype, sid)
-	//if res := redis.Get("newother", catchKey); res == nil || res == "" {
-	industry := s.GetString("industry")
-	var shareid = s.GetString("id")
-	if len(shareid) == 0 {
-		shareid = "10"
-	}
-	s.T["logid"] = config.Seoconfig["jysskzy"].(string)
-	s.T["shareid"] = se.EncodeString(shareid)
-	//s.T["keywords"] = s.GetString("kds")
-
-	s.DisableHttpCache()
-	po, bo, wo, obj := pcVRT(sid, industry, stype, false)
-	if obj != nil && len(obj) > 0 {
-		if len(po) > 0 {
-			s.T["projectOther"] = po
-		}
-		if len(bo) > 0 {
-			s.T["buyerOther"] = bo
-		}
-		if len(wo) > 0 {
-			s.T["winnerOther"] = wo
+	if res := redis.Get(redisLimitation, catchKey); res == nil || res == "" {
+		industry := s.GetString("industry")
+		var shareid = s.GetString("id")
+		if len(shareid) == 0 {
+			shareid = "10"
 		}
 		}
-		FieldProcessing(obj, "", industry, id, "", userId, stype, false)
-		obj["urlpath"] = s.Uri()
-		obj["industry"] = industry
+		s.T["logid"] = config.Seoconfig["jysskzy"].(string)
+		s.T["shareid"] = se.EncodeString(shareid)
+		//s.T["keywords"] = s.GetString("kds")
 
 
-		if userId == "" {
-			obj["winnerTitle"] = obj["winner"]
-			obj["buyerTitle"] = obj["buyer"]
-			obj["projectnameTitle"] = obj["projectname"]
-			obj["projectcodeTitle"] = obj["projectcode"]
-			log.Println(time.Now().UnixNano())
-			if obj["subtype"] == "拟建" {
-				otherFilter(obj, false)
-			} else {
-				obj = Filter(obj)
+		s.DisableHttpCache()
+		po, bo, wo, obj := pcVRT(sid, industry, stype, false)
+		if obj != nil && len(obj) > 0 {
+			if len(po) > 0 {
+				s.T["projectOther"] = po
 			}
 			}
-			//obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
-		}
-		obj["agency"] = ""
-		if obj["publishtime"] != nil {
-			obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["publishtime"]), 0).Format(date.Date_Short_Layout)
-		}
-		obj["keywords"] = KeyWordHandle(obj)
-		obj["description"] = DescriptionHandle("nologin", obj)
-		s.T["obj"] = obj
-		s.T["url"] = s.Uri()
-		s.T["newBidInfoList"] = tg.GetNewBidInfo()
-		s.T["industryInfoList"] = tg.GetConsult()
-		s.T["hotLabelList"] = tg.GetHotLabel(30)
-		s.T["simpleTemplateData"] = map[string]interface{}{
-			"obj": obj,
-		}
-		content, _ := s.Render4Cache("/pc/tags/detail.html", &s.T)
-		redis.Put("newother", catchKey, string(content), 60*2)
-		return s.SetBody(content)
-	}
-	//} else {
-	//	return s.SetBody([]byte(res.(string)))
-	//}
+			if len(bo) > 0 {
+				s.T["buyerOther"] = bo
+			}
+			if len(wo) > 0 {
+				s.T["winnerOther"] = wo
+			}
+			FieldProcessing(obj, "", industry, id, "", userId, stype, false)
+			obj["urlpath"] = s.Uri()
+			obj["industry"] = industry
+
+			if userId == "" {
+				obj["winnerTitle"] = obj["winner"]
+				obj["buyerTitle"] = obj["buyer"]
+				obj["projectnameTitle"] = obj["projectname"]
+				obj["projectcodeTitle"] = obj["projectcode"]
+				log.Println(time.Now().UnixNano())
+				if obj["subtype"] == "拟建" {
+					otherFilter(obj, false)
+				} else {
+					obj = Filter(obj)
+				}
+				//obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
+			}
+			obj["agency"] = ""
+			if obj["publishtime"] != nil {
+				obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["publishtime"]), 0).Format(date.Date_Short_Layout)
+			}
+			obj["keywords"] = KeyWordHandle(obj)
+			obj["description"] = DescriptionHandle("nologin", obj)
+			s.T["obj"] = obj
+			s.T["url"] = s.Uri()
+			s.T["newBidInfoList"] = tg.GetNewBidInfo()
+			s.T["industryInfoList"] = tg.GetConsult()
+			s.T["hotLabelList"] = tg.GetHotLabel(30)
+			s.T["simpleTemplateData"] = map[string]interface{}{
+				"obj": obj,
+			}
+			content, _ := s.Render4Cache("/pc/tags/detail.html", &s.T)
+			redis.Put(redisLimitation, catchKey, string(content), 60*2)
+			return s.SetBody(content)
+		}
+	} else {
+		return s.SetBody([]byte(res.(string)))
+	}
 	return nil
 	return nil
 }
 }
 
 

+ 5 - 1
src/jfw/front/swordfish.go

@@ -789,7 +789,11 @@ func pcVRT(sid, industry, content string, isPayUser bool) (po, bo, wo []map[stri
 			objdata = obj
 			objdata = obj
 			queryStr := ""
 			queryStr := ""
 			commonQuery := func(mustquery string) *[]map[string]interface{} {
 			commonQuery := func(mustquery string) *[]map[string]interface{} {
-				return nil //elastic.GetPage("bidding", "bidding", queryStr, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"`, 0, 11)
+				//付费用户可查看 详情页关联信息
+				if !isPayUser || content == "bdcontent" || content == "advancedProject" {
+					return nil //elastic.GetPage("bidding", "bidding", queryStr, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"`, 0, 11)
+				}
+				return elastic.GetPage("bidding", "bidding", queryStr, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"`, 0, 11)
 			}
 			}
 			//同一个项目的其他招标信息
 			//同一个项目的其他招标信息
 			projectName, _ := obj["projectname"].(string)
 			projectName, _ := obj["projectname"].(string)