|
@@ -86,12 +86,12 @@ func (s *Short) Article(stype, id string) error {
|
|
|
userId, _ := s.GetSession("userId").(string)
|
|
|
//PC端未登录用户程序走此逻辑 WX端走原来逻辑
|
|
|
if !mobileReg.MatchString(s.Header("User-Agent")) && (stype == "content" || stype == "indexcontent") && userId == "" {
|
|
|
- if seoAgentReg.MatchString(s.UserAgent()) {
|
|
|
- sids := encrypt.CommonDecodeArticle(stype, id)
|
|
|
- return s.NologinCommon("", stype, id, sids[0])
|
|
|
- } else {
|
|
|
- return s.Redirect("/notin/page")
|
|
|
- }
|
|
|
+ //if seoAgentReg.MatchString(s.UserAgent()) {
|
|
|
+ sids := encrypt.CommonDecodeArticle(stype, id)
|
|
|
+ return s.NologinCommon("", stype, id, sids[0])
|
|
|
+ //} else {
|
|
|
+ // return s.Redirect("/notin/page")
|
|
|
+ //}
|
|
|
}
|
|
|
return s.LoginCommon(userId, stype, id)
|
|
|
}
|
|
@@ -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,7 @@ 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 //商机管理服务
|
|
|
+ newCanRead = false
|
|
|
)
|
|
|
if res != nil && len(*res) > 0 {
|
|
|
if isVip && util.Int64All((*res)["l_vip_starttime"]) < util.Int64All(config.Sysconfig["contextOldVipLimit"]) {
|
|
@@ -319,6 +320,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 +346,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 +374,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,26 +383,12 @@ 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 {
|
|
|
- if canRead {
|
|
|
+ if canRead || util.ObjToString(obj["subtype"]) == "拟建" {
|
|
|
FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, true)
|
|
|
//免费用户正文手机号替换
|
|
|
if obj["site"] == "剑鱼信息发布平台" && !isMember {
|
|
@@ -431,6 +431,11 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
obj["entIds"] = winnerIdArr
|
|
|
}
|
|
|
}
|
|
|
+ if !canRead { //登录拟建&采购不展示遮罩 只打码
|
|
|
+ //canRead = true
|
|
|
+ //打码显示引导
|
|
|
+ otherFilter(obj, userId != "")
|
|
|
+ }
|
|
|
s.T["advertcode"] = s.GetString("advertcode")
|
|
|
} else {
|
|
|
obj = map[string]interface{}{
|
|
@@ -467,137 +472,159 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
}
|
|
|
sid := sids[0]
|
|
|
//免费用户浏览三级页判断留资与浏览次数
|
|
|
- indust := s.GetString("industry")
|
|
|
+ //indust := s.GetString("industry")
|
|
|
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"
|
|
|
+ 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["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
|
|
|
+ var detailKey = func() string {
|
|
|
+ if (isVip && isOldVip) || isMember || isEntniche || newCanRead || stype == "mailprivate" || stype == "indexcontent" || stype == "bdprivate" {
|
|
|
+ return "pay" //可以看全部
|
|
|
+ } else if isVip && !isOldVip {
|
|
|
+ return "new_vip_pay" //新版超级订阅不能看 采购意向
|
|
|
+ } else if SeeDetailLimit(nil, userId, sid) {
|
|
|
+ return "saleLeads_free" //未留资 三篇非采购意向信息;留资后同pay
|
|
|
} else {
|
|
|
- _, _, _, objc := pcVRT(sid, indust, stype, isVip || isMember || isEntniche)
|
|
|
- node = SeeDetailLimit(objc, userId, sid)
|
|
|
+ return "free" //已经免费查看三篇招标信息,且未留资。任何信息都不能看 有遮罩
|
|
|
}
|
|
|
-
|
|
|
- if obj["publishtime"] != nil {
|
|
|
- obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["publishtime"]), 0).Format(date.Date_Short_Layout)
|
|
|
+ }()
|
|
|
+ catchKey := fmt.Sprintf("jypcdetail_%s_%s_%s", detailKey, stype, sid)
|
|
|
+ log.Println(catchKey, "-缓存-", userId)
|
|
|
+ if res := redis.Get(redisLimitation, catchKey); res == nil || res == "" {
|
|
|
+ redisTimeOut := util.If((isVip && isOldVip) || isMember || isEntniche || 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, indust, 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 {
|
|
|
- if len(po) > 0 {
|
|
|
- s.T["projectOther"] = po
|
|
|
+
|
|
|
+ if obj["publishtime"] != nil {
|
|
|
+ obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["publishtime"]), 0).Format(date.Date_Short_Layout)
|
|
|
}
|
|
|
- if len(bo) > 0 {
|
|
|
- s.T["buyerOther"] = bo
|
|
|
+ s.T["canRead"] = node
|
|
|
+ if newCanRead {
|
|
|
+ s.T["canRead"] = newCanRead
|
|
|
}
|
|
|
- if len(wo) > 0 {
|
|
|
- s.T["winnerOther"] = wo
|
|
|
- }
|
|
|
- //判断时间 //如果是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"],
|
|
|
}
|
|
|
}
|
|
|
- } 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
|
|
@@ -661,7 +688,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"]
|
|
@@ -669,7 +696,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 {
|
|
@@ -681,7 +708,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
|
|
|
}
|
|
|
}
|
|
@@ -783,8 +810,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))
|
|
@@ -796,7 +823,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:]
|
|
|
//公告三级页处理
|
|
@@ -979,10 +1006,26 @@ func Filter(obj map[string]interface{}) map[string]interface{} {
|
|
|
// }
|
|
|
//}
|
|
|
//
|
|
|
+ if detailNeedMosaic == nil {
|
|
|
+ detailNeedMosaic, _ = config.Sysconfig["detailNeedMosaic"].(map[string]interface{})
|
|
|
+ }
|
|
|
for dk, dv := range detailNeedMosaic {
|
|
|
if !dv.(bool) {
|
|
|
continue
|
|
|
}
|
|
|
+ if obj["package"] != nil {
|
|
|
+ pk := util.ObjToMap(obj["package"])
|
|
|
+ for _, pv := range *pk {
|
|
|
+ if pv != nil {
|
|
|
+ if page := util.ObjToMap(pv); page != nil {
|
|
|
+ if (*page)[dk] != nil {
|
|
|
+ (*page)[dk] = mosaicText
|
|
|
+ }
|
|
|
+ delete(*page, "text")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//if util.ObjToString(obj[dk]) != "" {
|
|
|
// detail = strings.ReplaceAll(detail, util.ObjToString(obj[dk]), detailText)
|
|
|
//}
|
|
@@ -1013,6 +1056,65 @@ func Filter(obj map[string]interface{}) map[string]interface{} {
|
|
|
return obj
|
|
|
}
|
|
|
|
|
|
+// 拟建采购意向用户进行数据过滤 name 配置文件
|
|
|
+func otherFilter(obj map[string]interface{}, isLogin bool) map[string]interface{} {
|
|
|
+ txt := util.If(isLogin, "解锁会员查看", "登陆后解锁会员查看").(string)
|
|
|
+ detail := fmt.Sprint(obj["detail"])
|
|
|
+ mosaicText := fmt.Sprintf(`<span class="highlight-text otherMosaic">%s</span>`, txt)
|
|
|
+ detailText := fmt.Sprintf(`<span class="highlight-text otherMosaic">%s</span>`, txt)
|
|
|
+ var (
|
|
|
+ projectinfo map[string]interface{}
|
|
|
+ )
|
|
|
+
|
|
|
+ var otherMosaic map[string]interface{}
|
|
|
+ if obj["subtype"] == "拟建" {
|
|
|
+ otherMosaic, _ = config.Sysconfig["planBuildMosaic"].(map[string]interface{})
|
|
|
+ projectinfo, _ = obj["projectinfo"].(map[string]interface{}) //1.项目信息打码处理
|
|
|
+ } else if obj["subtype"] == "采购意向" {
|
|
|
+ otherMosaic, _ = config.Sysconfig["purchaseMosaic"].(map[string]interface{})
|
|
|
+ procurementlist, _ := obj["procurementlist"].([]interface{})
|
|
|
+ for _, vs := range procurementlist { //1.采购意向清单数据集打码处理
|
|
|
+ vsMap, _ := vs.(map[string]interface{})
|
|
|
+ for _, vsq := range vsMap {
|
|
|
+ if vs1, ok := vsq.(string); ok && vs1 != "" {
|
|
|
+ detail = strings.ReplaceAll(detail, util.InterfaceToStr(vsq), detailText)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ delete(obj, "procurementlist")
|
|
|
+ }
|
|
|
+
|
|
|
+ for dk, dv := range otherMosaic {
|
|
|
+ if !dv.(bool) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if vs, ok := projectinfo[dk]; ok && vs != nil && vs != "" {
|
|
|
+ detail = strings.ReplaceAll(detail, util.InterfaceToStr(vs), detailText)
|
|
|
+ projectinfo[dk] = mosaicText
|
|
|
+ }
|
|
|
+ if vs, ok := obj[dk]; ok && vs != nil && vs != "" {
|
|
|
+ value, b := obj[dk].(float64)
|
|
|
+ if b {
|
|
|
+ replaceStr := fmt.Sprintf("%v", int64(value))
|
|
|
+ detail = strings.ReplaceAll(detail, replaceStr, detailText)
|
|
|
+ } else {
|
|
|
+ detail = strings.ReplaceAll(detail, util.InterfaceToStr(obj[dk]), detailText)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ obj[dk] = mosaicText
|
|
|
+ }
|
|
|
+ if obj["subtype"] == "拟建" {
|
|
|
+ for k := range projectinfo {
|
|
|
+ if _, ok := otherMosaic[k]; !ok {
|
|
|
+ delete(projectinfo, k)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ obj["projectinfo"] = projectinfo
|
|
|
+ }
|
|
|
+ obj["detail"] = detail
|
|
|
+ return obj
|
|
|
+}
|
|
|
+
|
|
|
// 未登录用户进行数据过滤 name 配置文件
|
|
|
func SearchFilter(obj map[string]interface{}) map[string]interface{} {
|
|
|
//detail := fmt.Sprint(obj["detail"])
|
|
@@ -1085,7 +1187,7 @@ 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 == "" {
|
|
|
+ if res := redis.Get(redisLimitation, catchKey); true || res == nil || res == "" {
|
|
|
industry := s.GetString("industry")
|
|
|
var shareid = s.GetString("id")
|
|
|
if len(shareid) == 0 {
|
|
@@ -1094,10 +1196,12 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
|
|
|
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 obj["subtype"] == "采购意向" { //未登录不能访问采购意向
|
|
|
+ return s.Redirect("/notin/page", 302)
|
|
|
+ }
|
|
|
if len(po) > 0 {
|
|
|
s.T["projectOther"] = po
|
|
|
}
|
|
@@ -1117,7 +1221,11 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
|
|
|
obj["projectnameTitle"] = obj["projectname"]
|
|
|
obj["projectcodeTitle"] = obj["projectcode"]
|
|
|
log.Println(time.Now().UnixNano())
|
|
|
- obj = Filter(obj)
|
|
|
+ if obj["subtype"] == "拟建" {
|
|
|
+ otherFilter(obj, false)
|
|
|
+ } else {
|
|
|
+ obj = Filter(obj)
|
|
|
+ }
|
|
|
//obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
|
|
|
}
|
|
|
obj["agency"] = ""
|
|
@@ -1132,42 +1240,10 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
|
|
|
s.T["industryInfoList"] = tg.GetConsult()
|
|
|
s.T["hotLabelList"] = tg.GetHotLabel(30)
|
|
|
s.T["simpleTemplateData"] = map[string]interface{}{
|
|
|
- "obj": map[string]interface{}{
|
|
|
- "subtype": obj["subtype"],
|
|
|
- "purchasing": obj["purchasing"],
|
|
|
- "package": obj["package"],
|
|
|
- "fwtscode": obj["fwtscode"],
|
|
|
- "fwtsname": obj["fwtsname"],
|
|
|
- "s_winner": obj["s_winner"],
|
|
|
- "projectname": obj["projectname"],
|
|
|
- "title": obj["title"],
|
|
|
- "area": obj["area"],
|
|
|
- "city": obj["city"],
|
|
|
- "agency": obj["agency"],
|
|
|
- "buyer": obj["buyer"],
|
|
|
- "buyerperson": obj["buyerperson"],
|
|
|
- "buyertel": obj["buyertel"],
|
|
|
- "winnertel": obj["winnertel"],
|
|
|
- "winner_enttel": obj["winner_enttel"],
|
|
|
- "bidamount": obj["bidamount"],
|
|
|
- "winner": obj["winner"],
|
|
|
- "budget": obj["budget"],
|
|
|
- "_id": obj["_id"],
|
|
|
- "projectinfo": obj["projectinfo"],
|
|
|
- "href": obj["href"],
|
|
|
- "winnerMap": obj["winnerMap"],
|
|
|
- "entId": obj["entId"],
|
|
|
- "publishtime": obj["publishtime"],
|
|
|
- "industry": obj["industry"],
|
|
|
- "s_subscopeclass": obj["s_subscopeclass"],
|
|
|
- "areaadd": obj["areaadd"],
|
|
|
- "stypeadd": obj["stypeadd"],
|
|
|
- "indadd": obj["indadd"],
|
|
|
- "type": obj["type"],
|
|
|
- },
|
|
|
+ "obj": obj,
|
|
|
}
|
|
|
content, _ := s.Render4Cache("/pc/tags/detail.html", &s.T)
|
|
|
- redis.Put("newother", catchKey, string(content), 60*2)
|
|
|
+ redis.Put(redisLimitation, catchKey, string(content), 60*2)
|
|
|
return s.SetBody(content)
|
|
|
}
|
|
|
} else {
|