|
@@ -4,15 +4,15 @@ import (
|
|
|
"database/sql"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
- "github.com/gogf/gf/v2/util/gconv"
|
|
|
"jy/src/jfw/config"
|
|
|
- "jy/src/jfw/jyutil"
|
|
|
"jy/src/jfw/wx"
|
|
|
"log"
|
|
|
"math/rand"
|
|
|
"net/url"
|
|
|
"strconv"
|
|
|
|
|
|
+ "jy/src/jfw/jyutil"
|
|
|
+
|
|
|
"app.yhyue.com/moapp/jypkg/public"
|
|
|
|
|
|
util "app.yhyue.com/moapp/jybase/common"
|
|
@@ -55,30 +55,6 @@ var Map_stype = map[string]bool{
|
|
|
"advancedProject": true,
|
|
|
}
|
|
|
|
|
|
-var TypeCodeMap = map[string]string{
|
|
|
- "拟建": "拟建项目",
|
|
|
- "采购意向": "采购意向",
|
|
|
- "预告": "招标预告",
|
|
|
- "预审": "资格预审",
|
|
|
- "预审结果": "资格预审结果",
|
|
|
- "论证意见": "论证意见",
|
|
|
- "需求公示": "需求公示",
|
|
|
- "招标": "公开招标",
|
|
|
- "邀标": "邀请招标",
|
|
|
- "询价": "询价采购",
|
|
|
- "竞谈": "竞争性谈判",
|
|
|
- "单一": "单一来源采购",
|
|
|
- "竞价": "竞价公告",
|
|
|
- "变更": "变更公告",
|
|
|
- "中标": "中标公示",
|
|
|
- "成交": "成交公告",
|
|
|
- "废标": "废标公告",
|
|
|
- "流标": "流标公告",
|
|
|
- "合同": "合同公告信息",
|
|
|
- "验收": "验收公告信息",
|
|
|
- "违规": "违规信息",
|
|
|
-}
|
|
|
-
|
|
|
var seoAgentReg = regexp.MustCompile("Baiduspider|360Spider|bingbot|Googlebot")
|
|
|
|
|
|
func (s *Short) Article(stype, id string) error {
|
|
@@ -174,7 +150,6 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
retMap["subtype"], _ = obj["subtype"].(string)
|
|
|
retMap["subscopeclass"], _ = obj["s_subscopeclass"].(string)
|
|
|
retMap["publishtime"] = util.IntAll(obj["publishtime"])
|
|
|
-
|
|
|
}
|
|
|
s.T["shareid"] = config.Seoconfig["baiduSEM-p"].(string)
|
|
|
s.T["logid"] = config.Seoconfig["baiduSEM-p"].(string)
|
|
@@ -209,6 +184,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
ssOpenid := s.Session().Get("s_m_openid")
|
|
|
po, bo, wo, obj := pcVRT(sid, industry, stype, true)
|
|
|
if obj != nil && len(obj) > 0 {
|
|
|
+
|
|
|
if len(po) > 0 {
|
|
|
s.T["projectOther"] = po
|
|
|
}
|
|
@@ -256,9 +232,9 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
}
|
|
|
s.T["url"] = s.Uri()
|
|
|
s.T["obj"] = obj
|
|
|
+
|
|
|
content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
|
|
|
- timeout := 60 * 20
|
|
|
- redis.Put("newother", catchKey, string(content), timeout)
|
|
|
+ redis.Put("newother", catchKey, string(content), 60*20)
|
|
|
return s.SetBody(content)
|
|
|
}
|
|
|
} else {
|
|
@@ -441,8 +417,6 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
s.T["advertUrl"] = config.Sysconfig["advertUrl"]
|
|
|
s.T["canRead"] = canRead
|
|
|
obj["industry"] = industry
|
|
|
- obj["keywords"] = KeyWordHandle(obj)
|
|
|
- obj["description"] = DescriptionHandle(stype, obj)
|
|
|
s.T["obj"] = obj
|
|
|
//获取打赏文案
|
|
|
s.T["rewardText"], s.T["advertText"] = getRewardText()
|
|
@@ -585,8 +559,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
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()
|
|
|
return s.Render("/pc/biddetail_rec.html", &s.T)
|
|
@@ -1034,8 +1007,7 @@ 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.T["keywords"] = s.GetString("kds")
|
|
|
s.DisableHttpCache()
|
|
|
po, bo, wo, obj := pcVRT(sid, industry, stype, false || false || false)
|
|
|
if obj != nil && len(obj) > 0 {
|
|
@@ -1051,7 +1023,6 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
|
|
|
FieldProcessing(obj, "", industry, id, "", userId, stype, false)
|
|
|
obj["urlpath"] = s.Uri()
|
|
|
obj["industry"] = industry
|
|
|
-
|
|
|
if userId == "" {
|
|
|
obj["winnerTitle"] = obj["winner"]
|
|
|
obj["buyerTitle"] = obj["buyer"]
|
|
@@ -1059,21 +1030,18 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
|
|
|
obj["projectcodeTitle"] = obj["projectcode"]
|
|
|
log.Println(time.Now().UnixNano())
|
|
|
obj = Filter(obj)
|
|
|
- //obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
|
|
|
+ obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
|
|
|
}
|
|
|
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)
|
|
|
content, _ := s.Render4Cache("/pc/tags/detail.html", &s.T)
|
|
|
- timeout := 60 * 60 * 24
|
|
|
- redis.Put("newother", catchKey, string(content), timeout)
|
|
|
+ redis.Put("newother", catchKey, string(content), 60*2)
|
|
|
return s.SetBody(content)
|
|
|
}
|
|
|
} else {
|
|
@@ -1151,91 +1119,3 @@ func RegDetail(html string) string {
|
|
|
}
|
|
|
return ""
|
|
|
}
|
|
|
-
|
|
|
-func KeyWordHandle(obj map[string]interface{}) string {
|
|
|
- keywordArr := []string{}
|
|
|
- owner := util.InterfaceToStr(obj["owner"])
|
|
|
- buyer := util.InterfaceToStr(obj["buyer"])
|
|
|
- if buyer == "" {
|
|
|
- buyer = owner
|
|
|
- }
|
|
|
- if buyer != "" && buyer != config.Sysconfig["detailMosaicTxt"] {
|
|
|
- keywordArr = append(keywordArr, buyer)
|
|
|
- }
|
|
|
- if util.InterfaceToStr(obj["s_winner"]) != "" && util.InterfaceToStr(obj["s_winner"]) != config.Sysconfig["detailMosaicTxt"] {
|
|
|
- keywordArr = append(keywordArr, util.InterfaceToStr(obj["s_winner"]))
|
|
|
- }
|
|
|
- if obj["purchasinglist"] != nil && obj["purchasinglist"] != "" {
|
|
|
- i := 0
|
|
|
- for _, v := range gconv.SliceMap(obj["purchasinglist"]) {
|
|
|
- if i == 5 {
|
|
|
- break
|
|
|
- if util.InterfaceToStr(v["itemname"]) != "" && util.InterfaceToStr(obj["s_winner"]) != config.Sysconfig["detailMosaicTxt"] {
|
|
|
- keywordArr = append(keywordArr, util.InterfaceToStr(v["itemname"]))
|
|
|
- i++
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if util.InterfaceToStr(obj["subtype"]) != "" && util.InterfaceToStr(obj["subtype"]) != "其它" {
|
|
|
- keywordArr = append(keywordArr, TypeCodeMap[util.InterfaceToStr(obj["subtype"])])
|
|
|
- }
|
|
|
- if util.InterfaceToStr(obj["area"]) != "" {
|
|
|
- keywordArr = append(keywordArr, util.InterfaceToStr(obj["area"])+"招标")
|
|
|
- }
|
|
|
- if util.InterfaceToStr(obj["city"]) != "" {
|
|
|
- keywordArr = append(keywordArr, util.InterfaceToStr(obj["city"])+"招标")
|
|
|
- }
|
|
|
- keywordArr = append(keywordArr, "剑鱼标讯")
|
|
|
- keyword := strings.Join(keywordArr, ",")
|
|
|
- return keyword
|
|
|
-}
|
|
|
-func DescriptionHandle(stype string, obj map[string]interface{}) string {
|
|
|
- description := ""
|
|
|
- pushTime := time.Unix(util.Int64All(obj["publishtime"]), 0)
|
|
|
- title := util.InterfaceToStr(obj["title"])
|
|
|
- owner := util.InterfaceToStr(obj["owner"])
|
|
|
- buyer := util.InterfaceToStr(obj["buyer"])
|
|
|
- if buyer == "" {
|
|
|
- buyer = owner
|
|
|
- }
|
|
|
- s_winner := util.InterfaceToStr(obj["s_winner"])
|
|
|
- publishtime := util.Int64All(obj["publishtime"])
|
|
|
- area := util.InterfaceToStr(obj["area"])
|
|
|
- city := util.InterfaceToStr(obj["city"])
|
|
|
- if stype == "bdprivate" {
|
|
|
- //bdprivate
|
|
|
- //{项目标题},采购单位:{采购单位名称},成交供应商:{中标企业名称},公告日期:{公告日期}。
|
|
|
- descriptionArr := []string{}
|
|
|
- if title != "" {
|
|
|
- descriptionArr = append(descriptionArr, title)
|
|
|
- }
|
|
|
- if buyer != "" {
|
|
|
- descriptionArr = append(descriptionArr, fmt.Sprintf("采购单位:%s", buyer))
|
|
|
- }
|
|
|
- if s_winner != "" {
|
|
|
- descriptionArr = append(descriptionArr, fmt.Sprintf("成交供应商:%s", s_winner))
|
|
|
- }
|
|
|
- if publishtime != 0 {
|
|
|
- descriptionArr = append(descriptionArr, fmt.Sprintf("公告日期:%s", pushTime.Format("2006年01月02日")))
|
|
|
- }
|
|
|
- description = strings.Join(descriptionArr, ",")
|
|
|
- } else {
|
|
|
- //descriptionStr = "%s,项目所属地区是%s%s,项目采购单位是%s,项目发布时间是%s"
|
|
|
- descriptionArr := []string{}
|
|
|
- if title != "" {
|
|
|
- descriptionArr = append(descriptionArr, title)
|
|
|
- }
|
|
|
- if area != "" || city != "" {
|
|
|
- descriptionArr = append(descriptionArr, fmt.Sprintf("项目所属地区是%s%s", area, city))
|
|
|
- }
|
|
|
- if buyer != "" {
|
|
|
- descriptionArr = append(descriptionArr, fmt.Sprintf("项目采购单位是%s", buyer))
|
|
|
- }
|
|
|
- if publishtime != 0 {
|
|
|
- descriptionArr = append(descriptionArr, fmt.Sprintf("项目发布时间是%s", pushTime.Format("2006年01月02日")))
|
|
|
- }
|
|
|
- description = strings.Join(descriptionArr, ",")
|
|
|
- }
|
|
|
- return description
|
|
|
-}
|