|
@@ -202,7 +202,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
return nil
|
|
|
}
|
|
|
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")
|
|
|
var shareid = s.GetString("id")
|
|
|
if len(shareid) == 0 {
|
|
@@ -265,7 +265,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
obj["description"] = DescriptionHandle(stype, obj)
|
|
|
s.T["obj"] = obj
|
|
|
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)
|
|
|
}
|
|
|
} else {
|
|
@@ -296,6 +296,8 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
isEntniche bool = userPower.EntnicheStatus > 0 //商机管理
|
|
|
privatedata bool = userPower.PrivateGD //广东移动DICT 用户
|
|
|
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 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["isEntnicheNew"] = isEntnicheNew
|
|
|
s.T["isEntService"] = isEntService
|
|
|
+
|
|
|
if bm {
|
|
|
//判断有没有取关,取关的话,跳转到关于剑鱼标讯页面
|
|
|
if ssOpenid != nil && ssOpenid != "" {
|
|
@@ -344,6 +347,18 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
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
|
|
|
if shareopenid != "" {
|
|
|
s.T["shareopenid"] = shareopenid
|
|
@@ -360,7 +375,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
s.T["nickname"] = mynickname
|
|
|
s.T["avatar"] = myavatar
|
|
|
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
|
|
|
if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
|
|
|
((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) || //新超级订阅非采购意向”和“拟建项目”
|
|
@@ -369,22 +384,8 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
} else {
|
|
|
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
|
|
|
}
|
|
|
if len(obj) > 0 {
|
|
@@ -476,138 +477,144 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
if userId != "" && stype == "indexcontent" { //已登录用户直接跳转至正常三级页
|
|
|
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 {
|
|
|
- //_, _, _, 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 {
|
|
|
- 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
|
|
@@ -671,7 +678,7 @@ func SeeDetailLimit(obj map[string]interface{}, userId, sid string) bool {
|
|
|
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 != "" {
|
|
|
sidss := strings.Split(resVal, "_")
|
|
|
canRead := config.Sysconfig["canReadNotice"]
|
|
@@ -679,7 +686,7 @@ func SeeDetailLimit(obj map[string]interface{}, userId, sid string) bool {
|
|
|
sidss = append(sidss, sid)
|
|
|
arrs := RemoveDuplicatesAndEmpty(sidss)
|
|
|
newVal := strings.Join(arrs, "_")
|
|
|
- redis.Put("other", watchKey, newVal, jy.GetExpire())
|
|
|
+ redis.Put(redisLimitation, watchKey, newVal, jy.GetExpire())
|
|
|
return true
|
|
|
} else {
|
|
|
for _, v := range sidss {
|
|
@@ -691,7 +698,7 @@ func SeeDetailLimit(obj map[string]interface{}, userId, sid string) bool {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- redis.Put("other", watchKey, sid, jy.GetExpire())
|
|
|
+ redis.Put(redisLimitation, watchKey, sid, jy.GetExpire())
|
|
|
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"]) != "拟建" { //分享开打的
|
|
|
article_id := encrypt.CommonDecodeArticle(stype, id)[0]
|
|
|
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)
|
|
|
if err != nil {
|
|
|
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 为空时处理
|
|
|
func disWordNil(disWord, userId string) string {
|
|
|
var from_userid string
|
|
|
- redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|
|
|
+ redisDis := redis.GetStr(redisLimitation, "DIS_"+disWord[1:])
|
|
|
if redisDis != "" {
|
|
|
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 {
|
|
|
tg := &Tags{}
|
|
|
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
|
|
|
}
|
|
|
|