|
@@ -37,6 +37,7 @@ var mobileReg = regexp.MustCompile("(?i)(Android|Mobile|Phone)")
|
|
|
var DateFullLayout = "2006-01-02 15:04:05"
|
|
|
var Map_stype = map[string]bool{
|
|
|
"content": true,
|
|
|
+ "entservice": true,
|
|
|
"bdprivate": true,
|
|
|
"mailprivate": true,
|
|
|
"bdcontent": true,
|
|
@@ -126,6 +127,94 @@ func (s *Short) Article(stype, id string) error {
|
|
|
if stype == "bdcontent" {
|
|
|
stype = "content"
|
|
|
}
|
|
|
+ } else if stype == "entservice" { //大客户数据快照展示
|
|
|
+ //SE := util.SimpleEncrypt{"entservice"}
|
|
|
+ sid := util.SE3.DecodeString(id)
|
|
|
+ if len(sid) == 0 || (len(sid) > 0 && sid == "") {
|
|
|
+ s.Redirect("/notin/page", 302)
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ catchKey := fmt.Sprintf("jypcdetail_%s_%s_%s", userId, stype, sid)
|
|
|
+ if res := redis.Get("other", 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")
|
|
|
+ ssOpenid := s.Session().Get("s_m_openid")
|
|
|
+
|
|
|
+ po, bo, wo, obj := pcVRT(sid, industry, true)
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ obj["urlpath"] = s.Uri()
|
|
|
+ obj["industry"] = industry
|
|
|
+ if ssOpenid != nil {
|
|
|
+ obj["ucbsId"] = util.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
|
|
|
+ }
|
|
|
+ if isbid(obj["subtype"]) {
|
|
|
+ obj["winner_enttel"] = getwinnertel(obj["winner"])
|
|
|
+ }
|
|
|
+ //判断时间 //如果是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("/")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, true, false)
|
|
|
+
|
|
|
+ if obj["projectname"] != nil {
|
|
|
+ s.SetSession("projectname", obj["projectname"])
|
|
|
+ }
|
|
|
+ if obj["entidlist"] != nil { //大会员中标企业跳转至画像
|
|
|
+ if winner := util.ObjToString(obj["winner"]); winner != "" {
|
|
|
+ s_winner := util.ObjToString(obj["s_winner"])
|
|
|
+ idObjs, _ := obj["entidlist"].([]interface{})
|
|
|
+ winnerId := ""
|
|
|
+ if names := strings.Split(s_winner, ","); len(names) > 1 {
|
|
|
+ index := 0
|
|
|
+ for i := 0; i < len(names); i++ {
|
|
|
+ if names[i] == winner {
|
|
|
+ index = i
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(idObjs) > index {
|
|
|
+ winnerId = util.ObjToString(idObjs[index])
|
|
|
+ }
|
|
|
+ } else { //中标企业仅一个
|
|
|
+ if len(idObjs) > 0 {
|
|
|
+ winnerId = util.ObjToString(idObjs[0])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if winnerId != "" && winnerId != "-" {
|
|
|
+ obj["entId"] = util.EncodeArticleId2ByCheck(winnerId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ s.T["url"] = s.Uri()
|
|
|
+ s.T["obj"] = obj
|
|
|
+
|
|
|
+ content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
|
|
|
+ timeout := 60 * 20
|
|
|
+ redis.Put("other", catchKey, string(content), timeout)
|
|
|
+ return s.SetBody(content)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return s.SetBody([]byte(res.(string)))
|
|
|
+ }
|
|
|
}
|
|
|
ssOpenid := s.Session().Get("s_m_openid")
|
|
|
var res *map[string]interface{}
|
|
@@ -276,7 +365,6 @@ func (s *Short) Article(stype, id string) error {
|
|
|
} else {
|
|
|
nodeStr = "false"
|
|
|
}
|
|
|
- fmt.Println(s.T["canRead"])
|
|
|
if userId != "" && stype == "indexcontent" { //已登录用户直接跳转至正常三级页
|
|
|
return s.Redirect(fmt.Sprintf("/article/content/%s.html", util.CommonEncodeArticle("content", sid)))
|
|
|
}
|