|
@@ -1,37 +1,37 @@
|
|
package front
|
|
package front
|
|
|
|
|
|
import (
|
|
import (
|
|
- "context"
|
|
|
|
- "fmt"
|
|
|
|
- "jy/src/jfw/config"
|
|
|
|
- "jy/src/jfw/jyutil"
|
|
|
|
- "jy/src/jfw/paging"
|
|
|
|
- "log"
|
|
|
|
- "math"
|
|
|
|
- "math/rand"
|
|
|
|
- "net/http"
|
|
|
|
- "strconv"
|
|
|
|
- "strings"
|
|
|
|
- "time"
|
|
|
|
-
|
|
|
|
- qu "app.yhyue.com/moapp/jybase/common"
|
|
|
|
- "app.yhyue.com/moapp/jybase/date"
|
|
|
|
- "app.yhyue.com/moapp/jybase/encrypt"
|
|
|
|
- elastic "app.yhyue.com/moapp/jybase/es"
|
|
|
|
- "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
|
|
- "app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
|
- "app.yhyue.com/moapp/jybase/redis"
|
|
|
|
- "app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
|
|
|
|
- "app.yhyue.com/moapp/jypkg/public"
|
|
|
|
|
|
+ "context"
|
|
|
|
+ "fmt"
|
|
|
|
+ "jy/src/jfw/config"
|
|
|
|
+ "jy/src/jfw/jyutil"
|
|
|
|
+ "jy/src/jfw/paging"
|
|
|
|
+ "log"
|
|
|
|
+ "math"
|
|
|
|
+ "math/rand"
|
|
|
|
+ "net/http"
|
|
|
|
+ "strconv"
|
|
|
|
+ "strings"
|
|
|
|
+ "time"
|
|
|
|
+
|
|
|
|
+ qu "app.yhyue.com/moapp/jybase/common"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/date"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/encrypt"
|
|
|
|
+ elastic "app.yhyue.com/moapp/jybase/es"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/redis"
|
|
|
|
+ "app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
|
|
|
|
+ "app.yhyue.com/moapp/jypkg/public"
|
|
)
|
|
)
|
|
|
|
|
|
const cacheTime = 60 * 60 * 8
|
|
const cacheTime = 60 * 60 * 8
|
|
|
|
|
|
// 剑鱼标签页
|
|
// 剑鱼标签页
|
|
type Tags struct {
|
|
type Tags struct {
|
|
- *xweb.Action
|
|
|
|
- // searchResult xweb.Mapper `xweb:"/list/(\\w+)/(\\w+).html"` //剑鱼标讯分类 地区结果列表
|
|
|
|
- index xweb.Mapper `xweb:"/tags/(\\w+)/(\\w+).html"`
|
|
|
|
|
|
+ *xweb.Action
|
|
|
|
+ // searchResult xweb.Mapper `xweb:"/list/(\\w+)/(\\w+).html"` //剑鱼标讯分类 地区结果列表
|
|
|
|
+ index xweb.Mapper `xweb:"/tags/(\\w+)/(\\w+).html"`
|
|
}
|
|
}
|
|
|
|
|
|
var LetterArr = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
|
|
var LetterArr = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
|
|
@@ -40,29 +40,29 @@ var bidField = `"_id","site","title","publishtime","toptype","subtype","type","a
|
|
var seoBidField = `"_id","title","publishtime","subtype","area","href","bidamount","budget","s_subscopeclass","projectname"`
|
|
var seoBidField = `"_id","title","publishtime","subtype","area","href","bidamount","budget","s_subscopeclass","projectname"`
|
|
|
|
|
|
type reqLimit struct {
|
|
type reqLimit struct {
|
|
- doPool chan struct{}
|
|
|
|
- waitPool chan struct{}
|
|
|
|
|
|
+ doPool chan struct{}
|
|
|
|
+ waitPool chan struct{}
|
|
}
|
|
}
|
|
|
|
|
|
var reqLimitInit *reqLimit
|
|
var reqLimitInit *reqLimit
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
- xweb.AddAction(&Tags{})
|
|
|
|
- do := qu.IntAll(config.Sysconfig["executionNum"])
|
|
|
|
- wait := qu.IntAll(config.Sysconfig["awaitNum"])
|
|
|
|
- //创建执行池 等待池
|
|
|
|
- doPool := make(chan struct{}, do)
|
|
|
|
- for i := 0; i < do; i++ {
|
|
|
|
- doPool <- struct{}{}
|
|
|
|
- }
|
|
|
|
- waitPool := make(chan struct{}, wait)
|
|
|
|
- for i := 0; i < wait; i++ {
|
|
|
|
- waitPool <- struct{}{}
|
|
|
|
- }
|
|
|
|
- reqLimitInit = &reqLimit{
|
|
|
|
- doPool: doPool,
|
|
|
|
- waitPool: waitPool,
|
|
|
|
- }
|
|
|
|
|
|
+ xweb.AddAction(&Tags{})
|
|
|
|
+ do := qu.IntAll(config.Sysconfig["executionNum"])
|
|
|
|
+ wait := qu.IntAll(config.Sysconfig["awaitNum"])
|
|
|
|
+ //创建执行池 等待池
|
|
|
|
+ doPool := make(chan struct{}, do)
|
|
|
|
+ for i := 0; i < do; i++ {
|
|
|
|
+ doPool <- struct{}{}
|
|
|
|
+ }
|
|
|
|
+ waitPool := make(chan struct{}, wait)
|
|
|
|
+ for i := 0; i < wait; i++ {
|
|
|
|
+ waitPool <- struct{}{}
|
|
|
|
+ }
|
|
|
|
+ reqLimitInit = &reqLimit{
|
|
|
|
+ doPool: doPool,
|
|
|
|
+ waitPool: waitPool,
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -73,252 +73,253 @@ func init() {
|
|
*/
|
|
*/
|
|
|
|
|
|
func (this *Tags) Index(types, name string) {
|
|
func (this *Tags) Index(types, name string) {
|
|
- defer qu.Catch()
|
|
|
|
- info := strings.Split(name, "_")
|
|
|
|
- checkedInfoType := "all" //选择的信息类型
|
|
|
|
- checkedArea := "all" //选择的地区
|
|
|
|
- checkedProvince, checkedCity := "", ""
|
|
|
|
- checkedIndustry := "all" //选择的行业 一级
|
|
|
|
- checkedIndustry_2 := "" //选择的行业 二级
|
|
|
|
- checkedLetter := "all" //选择的字母
|
|
|
|
- checkedSite := "" //选择的站点名称
|
|
|
|
- checkedKeywords := "" //选择的关键词
|
|
|
|
- haveList := false //用于判断是否有bidding数据
|
|
|
|
- filters := map[string]interface{}{} //用于前端展示高亮的
|
|
|
|
- keywordSuffix := "" //关键词后缀
|
|
|
|
- areaHref := "/tags/area/all_%v.html" //用于拼接省份跳转地址
|
|
|
|
- industryHref := "/tags/industry/all_all_all.html" //用于拼接行业跳转地址
|
|
|
|
- if len(info) > 2 {
|
|
|
|
- checkedInfoType = info[2]
|
|
|
|
- haveList = true
|
|
|
|
- }
|
|
|
|
- if len(info) >= 2 {
|
|
|
|
- checkedIndustry = info[0]
|
|
|
|
- checkedArea = info[1]
|
|
|
|
- }
|
|
|
|
- crumbsNav1, crumbsNav2 := map[string]interface{}{}, map[string]interface{}{} //面包屑导航1,面包屑导航2
|
|
|
|
- pageNum := 0
|
|
|
|
- //获取seo地区对应关系
|
|
|
|
- provinceArr, cityArr, _, _, AreaCodeToName, _ := this.GetSEOArea()
|
|
|
|
- //获取seo站点名称对应关系
|
|
|
|
- bidPlatformNameToCode, bidPlatformCodeToName := GetBiddingPlatformType()
|
|
|
|
- //判断是哪个省份城市
|
|
|
|
- if checkedArea != "all" {
|
|
|
|
- //获取seo的对应关系
|
|
|
|
- i_area, _ := strconv.Atoi(checkedArea)
|
|
|
|
- s_area := AreaCodeToName[int64(i_area)]
|
|
|
|
- this.T["area"] = s_area
|
|
|
|
- if IsInArr(provinceArr, s_area) {
|
|
|
|
- checkedProvince = s_area
|
|
|
|
- }
|
|
|
|
- if IsInArr(cityArr, s_area) {
|
|
|
|
- checkedCity = s_area
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.T["area"] = "全国"
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if checkedIndustry == "all" {
|
|
|
|
- checkedIndustry = ""
|
|
|
|
- }
|
|
|
|
- filters["area"] = this.T["area"]
|
|
|
|
-
|
|
|
|
- InfoType, filterInfoType := this.GetInfoType(checkedInfoType)
|
|
|
|
- infotypeStr := ""
|
|
|
|
- if checkedInfoType != "all" {
|
|
|
|
- filters["stype"] = filterInfoType
|
|
|
|
- infotypeStr = filterInfoType
|
|
|
|
- } else {
|
|
|
|
- filters["stype"] = "全部"
|
|
|
|
- }
|
|
|
|
- //类型
|
|
|
|
- switch types {
|
|
|
|
- case "area":
|
|
|
|
- crumbsNav1 = map[string]interface{}{
|
|
|
|
- "name": "招标地区分类",
|
|
|
|
- "url": "/tags/area/all.html",
|
|
|
|
- }
|
|
|
|
- if len(info) >= 4 { //length大于4 说明为标签详情页
|
|
|
|
- i_site, _ := strconv.Atoi(info[3])
|
|
|
|
- site := bidPlatformCodeToName[int64(i_site)]
|
|
|
|
- checkedSite = qu.ObjToString(this.T["area"]) + site
|
|
|
|
-
|
|
|
|
- crumbsNav2 = map[string]interface{}{
|
|
|
|
- "name": qu.ObjToString(this.T["area"]) + site + infotypeStr,
|
|
|
|
- }
|
|
|
|
- checkedKeywords = site
|
|
|
|
- }
|
|
|
|
- filters["keywords"] = qu.If(checkedSite != "", checkedSite, this.T["area"])
|
|
|
|
- //便利获取地区招标标签词
|
|
|
|
- areaPlatform := []map[string]interface{}{}
|
|
|
|
- for _, v := range qu.ObjArrToStringArr(config.Seoconfig["areaSite"].([]interface{})) {
|
|
|
|
- area := qu.ObjToString(this.T["area"])
|
|
|
|
- areaPlatform = append(areaPlatform, map[string]interface{}{
|
|
|
|
- "name": fmt.Sprintf("%s%s", area, v),
|
|
|
|
- "url": fmt.Sprintf("/tags/area/all_%v_all_%v.html", checkedArea, bidPlatformNameToCode[v]),
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- if len(info) == 4 {
|
|
|
|
- areaHref = fmt.Sprintf("/tags/area/%v_%v_%v_%v.html", info[0], "%v", info[2], info[3])
|
|
|
|
- } else if len(info) == 3 {
|
|
|
|
- areaHref = fmt.Sprintf("/tags/area/%v_%v_%v.html", info[0], "%v", info[2])
|
|
|
|
- }
|
|
|
|
- this.T["areaPlatformWordsList"] = areaPlatform
|
|
|
|
- case "letter":
|
|
|
|
- //只有两位时,默认为汇总页,大于两位为标签页
|
|
|
|
- if len(info) == 2 {
|
|
|
|
- checkedLetter = info[0]
|
|
|
|
- pageNum, _ = strconv.Atoi(info[1])
|
|
|
|
- //按字母分类
|
|
|
|
- this.T["letterList"], this.T["letterListCount"], this.T["pagingMap"] = this.GetLetterPaging(pageNum, checkedLetter)
|
|
|
|
- } else if len(info) > 3 {
|
|
|
|
- checkedLetter = info[3]
|
|
|
|
- checkedKeywordsId := info[4]
|
|
|
|
- checkedKeywords, keywordSuffix = this.GetSeoKeyWords(checkedKeywordsId)
|
|
|
|
- areaHref = fmt.Sprintf("/tags/letter/all_%s_%s_%s_%s", "%v", checkedInfoType, checkedLetter, checkedKeywordsId)
|
|
|
|
- filters["keywords"] = checkedKeywords
|
|
|
|
- }
|
|
|
|
- filters["letter"] = checkedLetter
|
|
|
|
- crumbsNav1 = map[string]interface{}{
|
|
|
|
- "name": fmt.Sprintf("招标采购%s类汇总", qu.If(checkedLetter == "all", "全部", checkedLetter)),
|
|
|
|
- "url": fmt.Sprintf("/tags/letter/%s_1.html", checkedLetter),
|
|
|
|
- }
|
|
|
|
- crumbsNav2 = map[string]interface{}{
|
|
|
|
- "name": checkedKeywords + keywordSuffix,
|
|
|
|
- }
|
|
|
|
- //行业_地区_信息类型
|
|
|
|
- case "industry":
|
|
|
|
- //areaHref = fmt.Sprintf("/tags/industry/all_%s_all.html", "%v")
|
|
|
|
- if len(info) > 3 {
|
|
|
|
- checkedKeywords, checkedIndustry, checkedIndustry_2 = this.GetInsturyKeywords(info[3])
|
|
|
|
- crumbsNav2 = map[string]interface{}{
|
|
|
|
- // "name": qu.ObjToString(this.T["area"]) + checkedIndustry + checkedKeywords,
|
|
|
|
- "name": qu.ObjToString(this.T["area"]) + checkedKeywords + qu.ObjToString(config.Seoconfig["seoKeywordSuffix"]) + infotypeStr,
|
|
|
|
- }
|
|
|
|
- filters["industry"] = checkedIndustry
|
|
|
|
- filters["keywords"] = checkedKeywords
|
|
|
|
- areaHref = fmt.Sprintf("/tags/industry/%s_%s_%s_%s.html", info[0], "%v", info[2], info[3])
|
|
|
|
- industryHref = fmt.Sprintf("/tags/industry/%s_%s_%s_%s.html", "%v", info[1], info[3], "%v")
|
|
|
|
- checkedIndustry += "_" + checkedIndustry_2
|
|
|
|
- } else {
|
|
|
|
- haveList = false
|
|
|
|
- areaHref = fmt.Sprintf("/tags/industry/%s_%s_all.html", info[0], "%v")
|
|
|
|
- industryHref = fmt.Sprintf("/tags/industry/%s_%s_all_%s.html", "%v", checkedArea, "%v")
|
|
|
|
- //行业标签获取
|
|
|
|
- this.T["industryList"] = this.GetIndustry(industryHref) //需要根据地区获取不同的标的物
|
|
|
|
- }
|
|
|
|
- crumbsNav1 = map[string]interface{}{
|
|
|
|
- "name": fmt.Sprintf("招标行业分类"),
|
|
|
|
- "url": fmt.Sprintf("/tags/industry/all.html"),
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //地区标签获取
|
|
|
|
- this.T["areaList"] = this.GetArea(areaHref)
|
|
|
|
-
|
|
|
|
- //标的物标签获取
|
|
|
|
-
|
|
|
|
- //字母表获取
|
|
|
|
- this.T["alphabet"] = this.GetAlphabet()
|
|
|
|
- //老的按地域、按信息类型、热门招标
|
|
|
|
- //前端需要跳转的路由
|
|
|
|
- //for _, v := range []int{1, 2, 3} {
|
|
|
|
- // this.T[fmt.Sprintf("labUrl_%d", v)] = GetLabUrl(v) //1地域 2信息类型 3热门招标
|
|
|
|
- //}
|
|
|
|
- //右侧模块 最新招投标信息
|
|
|
|
- this.T["newBidInfoList"] = this.GetNewBidInfo()
|
|
|
|
-
|
|
|
|
- //右侧模块 行业咨询
|
|
|
|
- this.T["industryInfoList"] = this.GetConsult()
|
|
|
|
-
|
|
|
|
- //右侧模块 热词
|
|
|
|
- this.T["hotLabelList"] = this.GetHotLabel(30)
|
|
|
|
-
|
|
|
|
- //猜你喜欢
|
|
|
|
- this.T["guessLikeList"] = this.GetHotLabel(60)
|
|
|
|
- //信息类型
|
|
|
|
- thisUrl := this.Url()
|
|
|
|
- log.Println(strings.Split(thisUrl, "/"))
|
|
|
|
- thisUrlArr := strings.Split(thisUrl, "/")
|
|
|
|
- stypeHref := "/" + thisUrlArr[1] + "/" + thisUrlArr[2] + "/"
|
|
|
|
- if url2 := strings.Split(thisUrlArr[3], "_"); len(url2) > 2 {
|
|
|
|
- url2[2] = "%v"
|
|
|
|
- for k, v := range url2 {
|
|
|
|
- if k != 0 {
|
|
|
|
- stypeHref += "_"
|
|
|
|
- }
|
|
|
|
- stypeHref += v
|
|
|
|
- }
|
|
|
|
- if !strings.Contains(stypeHref, ".html") {
|
|
|
|
- stypeHref += ".html"
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.T["stypeList"] = this.GetStype(stypeHref)
|
|
|
|
- this.T["selectorAll"] = map[string]interface{}{
|
|
|
|
- "area": fmt.Sprintf(areaHref, "all"),
|
|
|
|
- "infoType": fmt.Sprintf(stypeHref, "all"),
|
|
|
|
- }
|
|
|
|
- //TDK
|
|
|
|
- this.T["tdk"] = this.GetTDK(haveList, types, checkedKeywords, pageNum, checkedLetter, qu.ObjToString(this.T["area"])+checkedKeywords, qu.ObjToString(this.T["area"])+checkedKeywords+infotypeStr, checkedKeywords, filterInfoType)
|
|
|
|
- if haveList {
|
|
|
|
- //信息类型
|
|
|
|
- isLimit := false
|
|
|
|
- this.T["biddingList"], this.T["biddingCount"], isLimit = this.GetBidding(checkedIndustry, checkedProvince, checkedCity, InfoType, checkedKeywords, this.Request, this.ResponseWriter, this.Session())
|
|
|
|
- if isLimit {
|
|
|
|
- this.Redirect("/504.html")
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- filters["biddingCount"] = this.T["biddingCount"]
|
|
|
|
- if qu.Int64All(this.T["biddingCount"]) == 0 && types == "letter" {
|
|
|
|
- this.T["letterList"], this.T["letterListCount"], this.T["pagingMap"] = this.GetLetterPaging(pageNum, checkedLetter)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.T["crumbsNav1"], this.T["crumbsNav2"] = crumbsNav1, crumbsNav2
|
|
|
|
-
|
|
|
|
- filters["searchKeywords"] = checkedKeywords
|
|
|
|
- this.T["type"] = types
|
|
|
|
- this.T["haveList"] = haveList
|
|
|
|
- this.T["downLoadQr"] = "https://www.jianyu360.cn/front/downloadJyApp/qr?page=pc_seo&source=pc_scan"
|
|
|
|
- this.T["url"] = this.Url()
|
|
|
|
- this.T["filters"] = filters
|
|
|
|
- this.T["nologin"] = qu.ObjToString(this.GetSession("userId")) == ""
|
|
|
|
- this.T["simpleTemplateData"] = map[string]interface{}{
|
|
|
|
- "filters": filters,
|
|
|
|
- "haveList": haveList,
|
|
|
|
- "type": types,
|
|
|
|
- }
|
|
|
|
- this.Render("/pc/tags/index.html", &this.T)
|
|
|
|
|
|
+ defer qu.Catch()
|
|
|
|
+ info := strings.Split(name, "_")
|
|
|
|
+ checkedInfoType := "all" //选择的信息类型
|
|
|
|
+ checkedArea := "all" //选择的地区
|
|
|
|
+ checkedProvince, checkedCity := "", ""
|
|
|
|
+ checkedIndustry := "all" //选择的行业 一级
|
|
|
|
+ checkedIndustry_2 := "" //选择的行业 二级
|
|
|
|
+ checkedLetter := "all" //选择的字母
|
|
|
|
+ checkedSite := "" //选择的站点名称
|
|
|
|
+ checkedKeywords := "" //选择的关键词
|
|
|
|
+ haveList := false //用于判断是否有bidding数据
|
|
|
|
+ filters := map[string]interface{}{} //用于前端展示高亮的
|
|
|
|
+ keywordSuffix := "" //关键词后缀
|
|
|
|
+ areaHref := "/tags/area/all_%v.html" //用于拼接省份跳转地址
|
|
|
|
+ industryHref := "/tags/industry/all_all_all.html" //用于拼接行业跳转地址
|
|
|
|
+ if len(info) > 2 {
|
|
|
|
+ checkedInfoType = info[2]
|
|
|
|
+ if checkedInfoType == "1" { // 1是拟建 p397 页面上已经没有入口了,在接口里面再过滤一下
|
|
|
|
+ checkedInfoType = "all"
|
|
|
|
+ }
|
|
|
|
+ haveList = true
|
|
|
|
+ }
|
|
|
|
+ if len(info) >= 2 {
|
|
|
|
+ checkedIndustry = info[0]
|
|
|
|
+ checkedArea = info[1]
|
|
|
|
+ }
|
|
|
|
+ crumbsNav1, crumbsNav2 := map[string]interface{}{}, map[string]interface{}{} //面包屑导航1,面包屑导航2
|
|
|
|
+ pageNum := 0
|
|
|
|
+ //获取seo地区对应关系
|
|
|
|
+ provinceArr, cityArr, _, _, AreaCodeToName, _ := this.GetSEOArea()
|
|
|
|
+ //获取seo站点名称对应关系
|
|
|
|
+ bidPlatformNameToCode, bidPlatformCodeToName := GetBiddingPlatformType()
|
|
|
|
+ //判断是哪个省份城市
|
|
|
|
+ if checkedArea != "all" {
|
|
|
|
+ //获取seo的对应关系
|
|
|
|
+ i_area, _ := strconv.Atoi(checkedArea)
|
|
|
|
+ s_area := AreaCodeToName[int64(i_area)]
|
|
|
|
+ this.T["area"] = s_area
|
|
|
|
+ if IsInArr(provinceArr, s_area) {
|
|
|
|
+ checkedProvince = s_area
|
|
|
|
+ }
|
|
|
|
+ if IsInArr(cityArr, s_area) {
|
|
|
|
+ checkedCity = s_area
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.T["area"] = "全国"
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if checkedIndustry == "all" {
|
|
|
|
+ checkedIndustry = ""
|
|
|
|
+ }
|
|
|
|
+ filters["area"] = this.T["area"]
|
|
|
|
+ InfoType, filterInfoType := this.GetInfoType(checkedInfoType)
|
|
|
|
+ infotypeStr := ""
|
|
|
|
+ if checkedInfoType != "all" {
|
|
|
|
+ filters["stype"] = filterInfoType
|
|
|
|
+ infotypeStr = filterInfoType
|
|
|
|
+ } else {
|
|
|
|
+ filters["stype"] = "全部"
|
|
|
|
+ }
|
|
|
|
+ //类型
|
|
|
|
+ switch types {
|
|
|
|
+ case "area":
|
|
|
|
+ crumbsNav1 = map[string]interface{}{
|
|
|
|
+ "name": "招标地区分类",
|
|
|
|
+ "url": "/tags/area/all.html",
|
|
|
|
+ }
|
|
|
|
+ if len(info) >= 4 { //length大于4 说明为标签详情页
|
|
|
|
+ i_site, _ := strconv.Atoi(info[3])
|
|
|
|
+ site := bidPlatformCodeToName[int64(i_site)]
|
|
|
|
+ checkedSite = qu.ObjToString(this.T["area"]) + site
|
|
|
|
+
|
|
|
|
+ crumbsNav2 = map[string]interface{}{
|
|
|
|
+ "name": qu.ObjToString(this.T["area"]) + site + infotypeStr,
|
|
|
|
+ }
|
|
|
|
+ checkedKeywords = site
|
|
|
|
+ }
|
|
|
|
+ filters["keywords"] = qu.If(checkedSite != "", checkedSite, this.T["area"])
|
|
|
|
+ //便利获取地区招标标签词
|
|
|
|
+ areaPlatform := []map[string]interface{}{}
|
|
|
|
+ for _, v := range qu.ObjArrToStringArr(config.Seoconfig["areaSite"].([]interface{})) {
|
|
|
|
+ area := qu.ObjToString(this.T["area"])
|
|
|
|
+ areaPlatform = append(areaPlatform, map[string]interface{}{
|
|
|
|
+ "name": fmt.Sprintf("%s%s", area, v),
|
|
|
|
+ "url": fmt.Sprintf("/tags/area/all_%v_all_%v.html", checkedArea, bidPlatformNameToCode[v]),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if len(info) == 4 {
|
|
|
|
+ areaHref = fmt.Sprintf("/tags/area/%v_%v_%v_%v.html", info[0], "%v", info[2], info[3])
|
|
|
|
+ } else if len(info) == 3 {
|
|
|
|
+ areaHref = fmt.Sprintf("/tags/area/%v_%v_%v.html", info[0], "%v", info[2])
|
|
|
|
+ }
|
|
|
|
+ this.T["areaPlatformWordsList"] = areaPlatform
|
|
|
|
+ case "letter":
|
|
|
|
+ //只有两位时,默认为汇总页,大于两位为标签页
|
|
|
|
+ if len(info) == 2 {
|
|
|
|
+ checkedLetter = info[0]
|
|
|
|
+ pageNum, _ = strconv.Atoi(info[1])
|
|
|
|
+ //按字母分类
|
|
|
|
+ this.T["letterList"], this.T["letterListCount"], this.T["pagingMap"] = this.GetLetterPaging(pageNum, checkedLetter)
|
|
|
|
+ } else if len(info) > 3 {
|
|
|
|
+ checkedLetter = info[3]
|
|
|
|
+ checkedKeywordsId := info[4]
|
|
|
|
+ checkedKeywords, keywordSuffix = this.GetSeoKeyWords(checkedKeywordsId)
|
|
|
|
+ areaHref = fmt.Sprintf("/tags/letter/all_%s_%s_%s_%s", "%v", checkedInfoType, checkedLetter, checkedKeywordsId)
|
|
|
|
+ filters["keywords"] = checkedKeywords
|
|
|
|
+ }
|
|
|
|
+ filters["letter"] = checkedLetter
|
|
|
|
+ crumbsNav1 = map[string]interface{}{
|
|
|
|
+ "name": fmt.Sprintf("招标采购%s类汇总", qu.If(checkedLetter == "all", "全部", checkedLetter)),
|
|
|
|
+ "url": fmt.Sprintf("/tags/letter/%s_1.html", checkedLetter),
|
|
|
|
+ }
|
|
|
|
+ crumbsNav2 = map[string]interface{}{
|
|
|
|
+ "name": checkedKeywords + keywordSuffix,
|
|
|
|
+ }
|
|
|
|
+ //行业_地区_信息类型
|
|
|
|
+ case "industry":
|
|
|
|
+ //areaHref = fmt.Sprintf("/tags/industry/all_%s_all.html", "%v")
|
|
|
|
+ if len(info) > 3 {
|
|
|
|
+ checkedKeywords, checkedIndustry, checkedIndustry_2 = this.GetInsturyKeywords(info[3])
|
|
|
|
+ crumbsNav2 = map[string]interface{}{
|
|
|
|
+ // "name": qu.ObjToString(this.T["area"]) + checkedIndustry + checkedKeywords,
|
|
|
|
+ "name": qu.ObjToString(this.T["area"]) + checkedKeywords + qu.ObjToString(config.Seoconfig["seoKeywordSuffix"]) + infotypeStr,
|
|
|
|
+ }
|
|
|
|
+ filters["industry"] = checkedIndustry
|
|
|
|
+ filters["keywords"] = checkedKeywords
|
|
|
|
+ areaHref = fmt.Sprintf("/tags/industry/%s_%s_%s_%s.html", info[0], "%v", info[2], info[3])
|
|
|
|
+ industryHref = fmt.Sprintf("/tags/industry/%s_%s_%s_%s.html", "%v", info[1], info[3], "%v")
|
|
|
|
+ checkedIndustry += "_" + checkedIndustry_2
|
|
|
|
+ } else {
|
|
|
|
+ haveList = false
|
|
|
|
+ areaHref = fmt.Sprintf("/tags/industry/%s_%s_all.html", info[0], "%v")
|
|
|
|
+ industryHref = fmt.Sprintf("/tags/industry/%s_%s_all_%s.html", "%v", checkedArea, "%v")
|
|
|
|
+ //行业标签获取
|
|
|
|
+ this.T["industryList"] = this.GetIndustry(industryHref) //需要根据地区获取不同的标的物
|
|
|
|
+ }
|
|
|
|
+ crumbsNav1 = map[string]interface{}{
|
|
|
|
+ "name": fmt.Sprintf("招标行业分类"),
|
|
|
|
+ "url": fmt.Sprintf("/tags/industry/all.html"),
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //地区标签获取
|
|
|
|
+ this.T["areaList"] = this.GetArea(areaHref)
|
|
|
|
+
|
|
|
|
+ //标的物标签获取
|
|
|
|
+
|
|
|
|
+ //字母表获取
|
|
|
|
+ this.T["alphabet"] = this.GetAlphabet()
|
|
|
|
+ //老的按地域、按信息类型、热门招标
|
|
|
|
+ //前端需要跳转的路由
|
|
|
|
+ //for _, v := range []int{1, 2, 3} {
|
|
|
|
+ // this.T[fmt.Sprintf("labUrl_%d", v)] = GetLabUrl(v) //1地域 2信息类型 3热门招标
|
|
|
|
+ //}
|
|
|
|
+ //右侧模块 最新招投标信息
|
|
|
|
+ this.T["newBidInfoList"] = this.GetNewBidInfo()
|
|
|
|
+
|
|
|
|
+ //右侧模块 行业咨询
|
|
|
|
+ this.T["industryInfoList"] = this.GetConsult()
|
|
|
|
+
|
|
|
|
+ //右侧模块 热词
|
|
|
|
+ this.T["hotLabelList"] = this.GetHotLabel(30)
|
|
|
|
+
|
|
|
|
+ //猜你喜欢
|
|
|
|
+ this.T["guessLikeList"] = this.GetHotLabel(60)
|
|
|
|
+ //信息类型
|
|
|
|
+ thisUrl := this.Url()
|
|
|
|
+ log.Println(strings.Split(thisUrl, "/"))
|
|
|
|
+ thisUrlArr := strings.Split(thisUrl, "/")
|
|
|
|
+ stypeHref := "/" + thisUrlArr[1] + "/" + thisUrlArr[2] + "/"
|
|
|
|
+ if url2 := strings.Split(thisUrlArr[3], "_"); len(url2) > 2 {
|
|
|
|
+ url2[2] = "%v"
|
|
|
|
+ for k, v := range url2 {
|
|
|
|
+ if k != 0 {
|
|
|
|
+ stypeHref += "_"
|
|
|
|
+ }
|
|
|
|
+ stypeHref += v
|
|
|
|
+ }
|
|
|
|
+ if !strings.Contains(stypeHref, ".html") {
|
|
|
|
+ stypeHref += ".html"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.T["stypeList"] = this.GetStype(stypeHref)
|
|
|
|
+ this.T["selectorAll"] = map[string]interface{}{
|
|
|
|
+ "area": fmt.Sprintf(areaHref, "all"),
|
|
|
|
+ "infoType": fmt.Sprintf(stypeHref, "all"),
|
|
|
|
+ }
|
|
|
|
+ //TDK
|
|
|
|
+ this.T["tdk"] = this.GetTDK(haveList, types, checkedKeywords, pageNum, checkedLetter, qu.ObjToString(this.T["area"])+checkedKeywords, qu.ObjToString(this.T["area"])+checkedKeywords+infotypeStr, checkedKeywords, filterInfoType)
|
|
|
|
+ if haveList {
|
|
|
|
+ //信息类型
|
|
|
|
+ isLimit := false
|
|
|
|
+ this.T["biddingList"], this.T["biddingCount"], isLimit = this.GetBidding(checkedIndustry, checkedProvince, checkedCity, InfoType, checkedKeywords, this.Request, this.ResponseWriter, this.Session())
|
|
|
|
+ if isLimit {
|
|
|
|
+ this.Redirect("/504.html")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ filters["biddingCount"] = this.T["biddingCount"]
|
|
|
|
+ if qu.Int64All(this.T["biddingCount"]) == 0 && types == "letter" {
|
|
|
|
+ this.T["letterList"], this.T["letterListCount"], this.T["pagingMap"] = this.GetLetterPaging(pageNum, checkedLetter)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.T["crumbsNav1"], this.T["crumbsNav2"] = crumbsNav1, crumbsNav2
|
|
|
|
+ filters["searchKeywords"] = checkedKeywords
|
|
|
|
+ this.T["type"] = types
|
|
|
|
+ this.T["haveList"] = haveList
|
|
|
|
+ this.T["downLoadQr"] = "https://www.jianyu360.cn/front/downloadJyApp/qr?page=pc_seo&source=pc_scan"
|
|
|
|
+ this.T["url"] = this.Url()
|
|
|
|
+ this.T["filters"] = filters
|
|
|
|
+ this.T["nologin"] = qu.ObjToString(this.GetSession("userId")) == ""
|
|
|
|
+ this.T["simpleTemplateData"] = map[string]interface{}{
|
|
|
|
+ "filters": filters,
|
|
|
|
+ "haveList": haveList,
|
|
|
|
+ "type": types,
|
|
|
|
+ }
|
|
|
|
+ this.Render("/pc/tags/index.html", &this.T)
|
|
}
|
|
}
|
|
|
|
|
|
// 标签行业获取
|
|
// 标签行业获取
|
|
// 地区汇总页:"/tags/area/all_%v_all.html"
|
|
// 地区汇总页:"/tags/area/all_%v_all.html"
|
|
func (this *Tags) GetArea(href string) []map[string]interface{} {
|
|
func (this *Tags) GetArea(href string) []map[string]interface{} {
|
|
- m := []map[string]interface{}{}
|
|
|
|
- provinceArr, _, _, nameToCode, codeToName, codeArr := this.GetSEOArea()
|
|
|
|
-
|
|
|
|
- //组成省市县的map
|
|
|
|
- for _, v := range provinceArr {
|
|
|
|
- cityMap := []map[string]interface{}{}
|
|
|
|
- for _, vv := range codeArr[nameToCode[v]] {
|
|
|
|
- districtMap := []map[string]interface{}{}
|
|
|
|
- for _, vvv := range codeArr[vv] {
|
|
|
|
- districtMap = append(districtMap, map[string]interface{}{
|
|
|
|
- "name": codeToName[vvv],
|
|
|
|
- "url": fmt.Sprintf(href, vvv),
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- cityMap = append(cityMap, map[string]interface{}{
|
|
|
|
- "name": codeToName[vv],
|
|
|
|
- "url": fmt.Sprintf(href, vv),
|
|
|
|
- "area": districtMap,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- m = append(m, map[string]interface{}{
|
|
|
|
- "name": v,
|
|
|
|
- "url": fmt.Sprintf(href, nameToCode[v]),
|
|
|
|
- "area": cityMap,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- return m
|
|
|
|
|
|
+ m := []map[string]interface{}{}
|
|
|
|
+ provinceArr, _, _, nameToCode, codeToName, codeArr := this.GetSEOArea()
|
|
|
|
+
|
|
|
|
+ //组成省市县的map
|
|
|
|
+ for _, v := range provinceArr {
|
|
|
|
+ cityMap := []map[string]interface{}{}
|
|
|
|
+ for _, vv := range codeArr[nameToCode[v]] {
|
|
|
|
+ districtMap := []map[string]interface{}{}
|
|
|
|
+ for _, vvv := range codeArr[vv] {
|
|
|
|
+ districtMap = append(districtMap, map[string]interface{}{
|
|
|
|
+ "name": codeToName[vvv],
|
|
|
|
+ "url": fmt.Sprintf(href, vvv),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ cityMap = append(cityMap, map[string]interface{}{
|
|
|
|
+ "name": codeToName[vv],
|
|
|
|
+ "url": fmt.Sprintf(href, vv),
|
|
|
|
+ "area": districtMap,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ m = append(m, map[string]interface{}{
|
|
|
|
+ "name": v,
|
|
|
|
+ "url": fmt.Sprintf(href, nameToCode[v]),
|
|
|
|
+ "area": cityMap,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ return m
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -330,534 +331,536 @@ codeToName //根据code获取名称
|
|
codeArr //code 及 pcode的从属关系
|
|
codeArr //code 及 pcode的从属关系
|
|
*/
|
|
*/
|
|
func (this *Tags) GetSEOArea() (provinceArr, cityArr, districtArr []string, nameToCode map[string]int64, codeToName map[int64]string, codeArr map[int64][]int64) {
|
|
func (this *Tags) GetSEOArea() (provinceArr, cityArr, districtArr []string, nameToCode map[string]int64, codeToName map[int64]string, codeArr map[int64][]int64) {
|
|
- provinceArr = []string{} //省份数组
|
|
|
|
- cityArr = []string{} //市数组
|
|
|
|
- districtArr = []string{} //区县数组
|
|
|
|
- nameToCode = map[string]int64{} //根据名称获取code
|
|
|
|
- codeToName = map[int64]string{} //根据code获取名称
|
|
|
|
- codeArr = map[int64][]int64{} //code 及 pcode的从属关系
|
|
|
|
- data := []map[string]interface{}{}
|
|
|
|
- rediskey := fmt.Sprintf("pcseo_area")
|
|
|
|
- if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
- data = qu.ObjArrToMapArr(l)
|
|
|
|
- } else {
|
|
|
|
- list := public.BaseMysql.SelectBySql(`select name,code,level,pcode from seo_words.seo_area order by code`)
|
|
|
|
- //获取组合成必要参数
|
|
|
|
- if list != nil && len(*list) > 0 {
|
|
|
|
- redis.Put("seoCache", rediskey, *list, cacheTime)
|
|
|
|
- data = *list
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- for _, v := range data {
|
|
|
|
- name := qu.ObjToString(v["name"]) //名称
|
|
|
|
- code := qu.Int64All(v["code"]) //行政区号
|
|
|
|
- level := qu.Int64All(v["level"])
|
|
|
|
- pcode := qu.Int64All(v["pcode"])
|
|
|
|
- if level == 1 {
|
|
|
|
- provinceArr = append(provinceArr, name)
|
|
|
|
-
|
|
|
|
- } else if level == 2 {
|
|
|
|
- cityArr = append(cityArr, name)
|
|
|
|
- } else {
|
|
|
|
- districtArr = append(districtArr, name)
|
|
|
|
- }
|
|
|
|
- nameToCode[name] = code
|
|
|
|
- codeToName[code] = name
|
|
|
|
- if pcode != 0 {
|
|
|
|
- codeArr[pcode] = append(codeArr[pcode], code)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
|
|
+ provinceArr = []string{} //省份数组
|
|
|
|
+ cityArr = []string{} //市数组
|
|
|
|
+ districtArr = []string{} //区县数组
|
|
|
|
+ nameToCode = map[string]int64{} //根据名称获取code
|
|
|
|
+ codeToName = map[int64]string{} //根据code获取名称
|
|
|
|
+ codeArr = map[int64][]int64{} //code 及 pcode的从属关系
|
|
|
|
+ data := []map[string]interface{}{}
|
|
|
|
+ rediskey := fmt.Sprintf("pcseo_area")
|
|
|
|
+ if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
+ data = qu.ObjArrToMapArr(l)
|
|
|
|
+ } else {
|
|
|
|
+ list := public.BaseMysql.SelectBySql(`select name,code,level,pcode from seo_words.seo_area order by code`)
|
|
|
|
+ //获取组合成必要参数
|
|
|
|
+ if list != nil && len(*list) > 0 {
|
|
|
|
+ redis.Put("seoCache", rediskey, *list, cacheTime)
|
|
|
|
+ data = *list
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for _, v := range data {
|
|
|
|
+ name := qu.ObjToString(v["name"]) //名称
|
|
|
|
+ code := qu.Int64All(v["code"]) //行政区号
|
|
|
|
+ level := qu.Int64All(v["level"])
|
|
|
|
+ pcode := qu.Int64All(v["pcode"])
|
|
|
|
+ if level == 1 {
|
|
|
|
+ provinceArr = append(provinceArr, name)
|
|
|
|
+
|
|
|
|
+ } else if level == 2 {
|
|
|
|
+ cityArr = append(cityArr, name)
|
|
|
|
+ } else {
|
|
|
|
+ districtArr = append(districtArr, name)
|
|
|
|
+ }
|
|
|
|
+ nameToCode[name] = code
|
|
|
|
+ codeToName[code] = name
|
|
|
|
+ if pcode != 0 {
|
|
|
|
+ codeArr[pcode] = append(codeArr[pcode], code)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
|
|
// 获取字母表跳转
|
|
// 获取字母表跳转
|
|
func (this *Tags) GetAlphabet() []map[string]interface{} {
|
|
func (this *Tags) GetAlphabet() []map[string]interface{} {
|
|
- m := []map[string]interface{}{}
|
|
|
|
- for _, v := range LetterArr {
|
|
|
|
- m = append(m, map[string]interface{}{
|
|
|
|
- "name": v,
|
|
|
|
- "url": fmt.Sprintf("/tags/letter/%s_1.html", v),
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- return m
|
|
|
|
|
|
+ m := []map[string]interface{}{}
|
|
|
|
+ for _, v := range LetterArr {
|
|
|
|
+ m = append(m, map[string]interface{}{
|
|
|
|
+ "name": v,
|
|
|
|
+ "url": fmt.Sprintf("/tags/letter/%s_1.html", v),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ return m
|
|
}
|
|
}
|
|
|
|
|
|
func (this *Tags) GetkeysMap() []map[string][]map[string]interface{} {
|
|
func (this *Tags) GetkeysMap() []map[string][]map[string]interface{} {
|
|
- mar := []map[string][]map[string]interface{}{}
|
|
|
|
- m := map[string][]map[string]interface{}{}
|
|
|
|
- sortArr := qu.ObjArrToStringArr(config.Seoconfig["hotlabkeywordsSort"].([]interface{}))
|
|
|
|
- data := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_industry_class`)
|
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
|
- for _, v := range *data {
|
|
|
|
- name := qu.ObjToString(v["name"])
|
|
|
|
- id := qu.Int64All(v["id"])
|
|
|
|
- r := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_industry where class_1 =? and state =1 limit 10`, name)
|
|
|
|
- if r != nil && len(*r) > 0 {
|
|
|
|
- for _, vv := range *r {
|
|
|
|
- name2 := qu.ObjToString(vv["name"])
|
|
|
|
- id2 := qu.Int64All(vv["id"])
|
|
|
|
- m[name] = append(m[name], map[string]interface{}{
|
|
|
|
- "key": name2,
|
|
|
|
- "url": fmt.Sprintf("/tags/industry/%v_all_all_%v.html", id, id2),
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- for _, v := range sortArr {
|
|
|
|
- mar = append(mar, map[string][]map[string]interface{}{v: m[v]})
|
|
|
|
- }
|
|
|
|
- return mar
|
|
|
|
|
|
+ mar := []map[string][]map[string]interface{}{}
|
|
|
|
+ m := map[string][]map[string]interface{}{}
|
|
|
|
+ sortArr := qu.ObjArrToStringArr(config.Seoconfig["hotlabkeywordsSort"].([]interface{}))
|
|
|
|
+ data := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_industry_class`)
|
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
|
+ for _, v := range *data {
|
|
|
|
+ name := qu.ObjToString(v["name"])
|
|
|
|
+ id := qu.Int64All(v["id"])
|
|
|
|
+ r := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_industry where class_1 =? and state =1 limit 10`, name)
|
|
|
|
+ if r != nil && len(*r) > 0 {
|
|
|
|
+ for _, vv := range *r {
|
|
|
|
+ name2 := qu.ObjToString(vv["name"])
|
|
|
|
+ id2 := qu.Int64All(vv["id"])
|
|
|
|
+ m[name] = append(m[name], map[string]interface{}{
|
|
|
|
+ "key": name2,
|
|
|
|
+ "url": fmt.Sprintf("/tags/industry/%v_all_all_%v.html", id, id2),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for _, v := range sortArr {
|
|
|
|
+ mar = append(mar, map[string][]map[string]interface{}{v: m[v]})
|
|
|
|
+ }
|
|
|
|
+ return mar
|
|
}
|
|
}
|
|
|
|
|
|
func (this *Tags) GetIndustry(industryHref string) interface{} {
|
|
func (this *Tags) GetIndustry(industryHref string) interface{} {
|
|
- rediskey := fmt.Sprintf("pcindex_getIndustry_%s", industryHref)
|
|
|
|
- if l := redis.Get("seoCache", rediskey); l != nil {
|
|
|
|
- return l
|
|
|
|
- } else {
|
|
|
|
- data := public.BaseMysql.SelectBySql(`select a.id,a.name,b.id class_id,b.name class_1 from seo_words.seo_industry a inner join seo_words.seo_industry_class b on a.state =1 and a.class_1=b.name and a.class_2 !='药品' order by a.class_1`)
|
|
|
|
- industryArr := []string{}
|
|
|
|
- industryMap := map[string][]map[string]interface{}{}
|
|
|
|
- if len(*data) > 0 && data != nil {
|
|
|
|
- for _, v := range *data {
|
|
|
|
- class := qu.ObjToString(v["class_1"])
|
|
|
|
- name := qu.ObjToString(v["name"])
|
|
|
|
- id := qu.Int64All(v["id"])
|
|
|
|
- industryId := qu.Int64All(v["class_id"])
|
|
|
|
- if !IsInArr(industryArr, class) {
|
|
|
|
- industryArr = append(industryArr, class)
|
|
|
|
- }
|
|
|
|
- industryMap[class] = append(industryMap[class], map[string]interface{}{
|
|
|
|
- "name": name + qu.ObjToString(config.Seoconfig["seoKeywordSuffix"]),
|
|
|
|
- // "url": fmt.Sprintf("/tags/industry/%v_all_all_%v.html", industryId, id),
|
|
|
|
- "url": fmt.Sprintf(industryHref, industryId, id),
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- m := []map[string][]map[string]interface{}{}
|
|
|
|
- //
|
|
|
|
- for _, v := range industryArr {
|
|
|
|
- m = append(m, map[string][]map[string]interface{}{
|
|
|
|
- v: industryMap[v],
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- redis.Put("seoCache", rediskey, m, cacheTime)
|
|
|
|
- return m
|
|
|
|
- }
|
|
|
|
|
|
+ rediskey := fmt.Sprintf("pcindex_getIndustry_%s", industryHref)
|
|
|
|
+ if l := redis.Get("seoCache", rediskey); l != nil {
|
|
|
|
+ return l
|
|
|
|
+ } else {
|
|
|
|
+ data := public.BaseMysql.SelectBySql(`select a.id,a.name,b.id class_id,b.name class_1 from seo_words.seo_industry a inner join seo_words.seo_industry_class b on a.state =1 and a.class_1=b.name and a.class_2 !='药品' order by a.class_1`)
|
|
|
|
+ industryArr := []string{}
|
|
|
|
+ industryMap := map[string][]map[string]interface{}{}
|
|
|
|
+ if len(*data) > 0 && data != nil {
|
|
|
|
+ for _, v := range *data {
|
|
|
|
+ class := qu.ObjToString(v["class_1"])
|
|
|
|
+ name := qu.ObjToString(v["name"])
|
|
|
|
+ id := qu.Int64All(v["id"])
|
|
|
|
+ industryId := qu.Int64All(v["class_id"])
|
|
|
|
+ if !IsInArr(industryArr, class) {
|
|
|
|
+ industryArr = append(industryArr, class)
|
|
|
|
+ }
|
|
|
|
+ industryMap[class] = append(industryMap[class], map[string]interface{}{
|
|
|
|
+ "name": name + qu.ObjToString(config.Seoconfig["seoKeywordSuffix"]),
|
|
|
|
+ // "url": fmt.Sprintf("/tags/industry/%v_all_all_%v.html", industryId, id),
|
|
|
|
+ "url": fmt.Sprintf(industryHref, industryId, id),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ m := []map[string][]map[string]interface{}{}
|
|
|
|
+ //
|
|
|
|
+ for _, v := range industryArr {
|
|
|
|
+ m = append(m, map[string][]map[string]interface{}{
|
|
|
|
+ v: industryMap[v],
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ redis.Put("seoCache", rediskey, m, cacheTime)
|
|
|
|
+ return m
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// 判断字符串是否再数组str内
|
|
// 判断字符串是否再数组str内
|
|
func IsInArr(arr []string, s string) bool {
|
|
func IsInArr(arr []string, s string) bool {
|
|
- for _, v := range arr {
|
|
|
|
- if v == s {
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
|
|
+ for _, v := range arr {
|
|
|
|
+ if v == s {
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
|
|
|
|
// 获取最新招标信息
|
|
// 获取最新招标信息
|
|
func (this *Tags) GetNewBidInfo() (list []map[string]interface{}) {
|
|
func (this *Tags) GetNewBidInfo() (list []map[string]interface{}) {
|
|
- rediskey := fmt.Sprintf("pcindex_newArticle")
|
|
|
|
- if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
- list = qu.ObjArrToMapArr(l)
|
|
|
|
- } else {
|
|
|
|
- _, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", "拟建,招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 50, "")
|
|
|
|
- if lists != nil && len(*lists) > 10 {
|
|
|
|
- *lists = (*lists)[0:10]
|
|
|
|
- for _, v := range *lists {
|
|
|
|
- v["_id"] = encrypt.CommonEncodeArticle("content", v["_id"].(string))
|
|
|
|
- delete(v, "toptype")
|
|
|
|
- delete(v, "s_subscopeclass")
|
|
|
|
- tmpdate := v["publishtime"]
|
|
|
|
- v["publishtime"] = qu.Int64All(tmpdate.(float64))
|
|
|
|
- v["date"] = time.Unix(qu.Int64All(tmpdate.(float64)), 0).Format(date.Date_Short_Layout)
|
|
|
|
- if v["budget"] != nil {
|
|
|
|
- v["budget"] = ConversionMoeny(v["budget"])
|
|
|
|
- } else if v["bidamount"] != nil {
|
|
|
|
- v["budget"] = ConversionMoeny(v["bidamount"])
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- list = *lists
|
|
|
|
- redis.Put("seoCache", rediskey, list, cacheTime)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return list
|
|
|
|
|
|
+ rediskey := fmt.Sprintf("pcindex_newArticle")
|
|
|
|
+ if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
+ list = qu.ObjArrToMapArr(l)
|
|
|
|
+ } else {
|
|
|
|
+ // p397 未登录详情页最新招投标信息去掉拟建
|
|
|
|
+ _, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", "招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 50, "")
|
|
|
|
+ if lists != nil && len(*lists) > 10 {
|
|
|
|
+ *lists = (*lists)[0:10]
|
|
|
|
+ for _, v := range *lists {
|
|
|
|
+ v["_id"] = encrypt.CommonEncodeArticle("content", v["_id"].(string))
|
|
|
|
+ delete(v, "toptype")
|
|
|
|
+ delete(v, "s_subscopeclass")
|
|
|
|
+ tmpdate := v["publishtime"]
|
|
|
|
+ v["publishtime"] = qu.Int64All(tmpdate.(float64))
|
|
|
|
+ v["date"] = time.Unix(qu.Int64All(tmpdate.(float64)), 0).Format(date.Date_Short_Layout)
|
|
|
|
+ if v["budget"] != nil {
|
|
|
|
+ v["budget"] = ConversionMoeny(v["budget"])
|
|
|
|
+ } else if v["bidamount"] != nil {
|
|
|
|
+ v["budget"] = ConversionMoeny(v["bidamount"])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ list = *lists
|
|
|
|
+ redis.Put("seoCache", rediskey, list, cacheTime)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return list
|
|
}
|
|
}
|
|
|
|
|
|
// 获取信息类型相关url
|
|
// 获取信息类型相关url
|
|
func (this *Tags) GetStype(href string) (list []map[string]interface{}) {
|
|
func (this *Tags) GetStype(href string) (list []map[string]interface{}) {
|
|
- rediskey := fmt.Sprintf("pcseo_stypelist_%s", href)
|
|
|
|
- if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
- list = qu.ObjArrToMapArr(l)
|
|
|
|
- } else {
|
|
|
|
- m := []map[string]interface{}{}
|
|
|
|
- data := public.BaseMysql.SelectBySql(`select id,name,pid from seo_words.seo_stype where name !="拟建项目" and name != "采购意向" and pid=0 order by id`)
|
|
|
|
- codeMap := map[int64][]int64{}
|
|
|
|
- level1 := []int64{}
|
|
|
|
- nameToCode := map[string]int64{}
|
|
|
|
- codeToName := map[int64]string{}
|
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
|
- for _, v := range *data {
|
|
|
|
- name := qu.ObjToString(v["name"])
|
|
|
|
- pid := qu.Int64All(v["pid"])
|
|
|
|
- id := qu.Int64All(v["id"])
|
|
|
|
- nameToCode[name] = id
|
|
|
|
- codeToName[id] = name
|
|
|
|
- codeMap[pid] = append(codeMap[pid], id)
|
|
|
|
- if pid == 0 {
|
|
|
|
- level1 = append(level1, id)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- for _, v := range level1 {
|
|
|
|
- m2 := []map[string]interface{}{}
|
|
|
|
- for _, vv := range codeMap[v] {
|
|
|
|
- m2 = append(m2, map[string]interface{}{
|
|
|
|
- "url": fmt.Sprintf(href, vv),
|
|
|
|
- "name": codeToName[vv],
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- m = append(m, map[string]interface{}{
|
|
|
|
- "url": fmt.Sprintf(href, v),
|
|
|
|
- "name": codeToName[v],
|
|
|
|
- "stype": m2,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- list = m
|
|
|
|
- redis.Put("seoCache", rediskey, list, cacheTime)
|
|
|
|
- }
|
|
|
|
- return list
|
|
|
|
|
|
+ rediskey := fmt.Sprintf("pcseo_stypelist_%s", href)
|
|
|
|
+ if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
+ list = qu.ObjArrToMapArr(l)
|
|
|
|
+ } else {
|
|
|
|
+ m := []map[string]interface{}{}
|
|
|
|
+ data := public.BaseMysql.SelectBySql(`select id,name,pid from seo_words.seo_stype where name !="拟建项目" and name != "采购意向" and pid=0 order by id`)
|
|
|
|
+ codeMap := map[int64][]int64{}
|
|
|
|
+ level1 := []int64{}
|
|
|
|
+ nameToCode := map[string]int64{}
|
|
|
|
+ codeToName := map[int64]string{}
|
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
|
+ for _, v := range *data {
|
|
|
|
+ name := qu.ObjToString(v["name"])
|
|
|
|
+ pid := qu.Int64All(v["pid"])
|
|
|
|
+ id := qu.Int64All(v["id"])
|
|
|
|
+ nameToCode[name] = id
|
|
|
|
+ codeToName[id] = name
|
|
|
|
+ codeMap[pid] = append(codeMap[pid], id)
|
|
|
|
+ if pid == 0 {
|
|
|
|
+ level1 = append(level1, id)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for _, v := range level1 {
|
|
|
|
+ m2 := []map[string]interface{}{}
|
|
|
|
+ for _, vv := range codeMap[v] {
|
|
|
|
+ m2 = append(m2, map[string]interface{}{
|
|
|
|
+ "url": fmt.Sprintf(href, vv),
|
|
|
|
+ "name": codeToName[vv],
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ m = append(m, map[string]interface{}{
|
|
|
|
+ "url": fmt.Sprintf(href, v),
|
|
|
|
+ "name": codeToName[v],
|
|
|
|
+ "stype": m2,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ list = m
|
|
|
|
+ redis.Put("seoCache", rediskey, list, cacheTime)
|
|
|
|
+ }
|
|
|
|
+ return list
|
|
}
|
|
}
|
|
|
|
|
|
// 剑鱼博客
|
|
// 剑鱼博客
|
|
func (this *Tags) GetConsult() (list []map[string]interface{}) {
|
|
func (this *Tags) GetConsult() (list []map[string]interface{}) {
|
|
- rediskey := fmt.Sprintf("pcseo_jybk")
|
|
|
|
- if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
- list = qu.ObjArrToMapArr(l)
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- rs, _, _ := jyutil.JyCmsSearch(map[string]string{
|
|
|
|
- "perPage": "10",
|
|
|
|
- }, "/jyblog/index_%s.html")
|
|
|
|
- if rs != nil {
|
|
|
|
- for _, v := range *rs {
|
|
|
|
- delete(v, "praise")
|
|
|
|
- delete(v, "s_contenttype")
|
|
|
|
- delete(v, "s_source")
|
|
|
|
- v["url"] = fmt.Sprintf("/jyblog/%s.html", qu.ObjToString(v["_id"]))
|
|
|
|
- }
|
|
|
|
- list = *rs
|
|
|
|
- redis.Put("seoCache", rediskey, list, cacheTime)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return list
|
|
|
|
|
|
+ rediskey := fmt.Sprintf("pcseo_jybk")
|
|
|
|
+ if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
+ list = qu.ObjArrToMapArr(l)
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ rs, _, _ := jyutil.JyCmsSearch(map[string]string{
|
|
|
|
+ "perPage": "10",
|
|
|
|
+ }, "/jyblog/index_%s.html")
|
|
|
|
+ if rs != nil {
|
|
|
|
+ for _, v := range *rs {
|
|
|
|
+ delete(v, "praise")
|
|
|
|
+ delete(v, "s_contenttype")
|
|
|
|
+ delete(v, "s_source")
|
|
|
|
+ v["url"] = fmt.Sprintf("/jyblog/%s.html", qu.ObjToString(v["_id"]))
|
|
|
|
+ }
|
|
|
|
+ list = *rs
|
|
|
|
+ redis.Put("seoCache", rediskey, list, cacheTime)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return list
|
|
}
|
|
}
|
|
|
|
|
|
func (this *Tags) GetLetterMap(pageSize, pageNum int64, letter string) ([]map[string]interface{}, int64) {
|
|
func (this *Tags) GetLetterMap(pageSize, pageNum int64, letter string) ([]map[string]interface{}, int64) {
|
|
- m := []map[string]interface{}{}
|
|
|
|
- sql := `select id,name,letter from seo_words.seo_resource where letter = ? and state=1 order by id desc`
|
|
|
|
- cql := `select count(1) from seo_words.seo_resource where letter = ? and state=1 `
|
|
|
|
- offset := (pageNum - 1) * pageSize
|
|
|
|
- sql += fmt.Sprintf(" limit %v,%v", offset, pageSize)
|
|
|
|
- data := public.BaseMysql.SelectBySql(sql, letter)
|
|
|
|
- count := public.BaseMysql.CountBySql(cql, letter)
|
|
|
|
- if data != nil {
|
|
|
|
- for _, v := range *data {
|
|
|
|
- letter := qu.ObjToString(v["letter"])
|
|
|
|
- id := qu.Int64All(v["id"])
|
|
|
|
- name := qu.ObjToString(v["name"])
|
|
|
|
- name += qu.ObjToString(config.Seoconfig["seoKeywordSuffix"])
|
|
|
|
- m = append(m, map[string]interface{}{
|
|
|
|
- "name": name,
|
|
|
|
- "url": fmt.Sprintf("/tags/letter/all_all_all_%v_%v.html", letter, id),
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return m, count
|
|
|
|
|
|
+ m := []map[string]interface{}{}
|
|
|
|
+ sql := `select id,name,letter from seo_words.seo_resource where letter = ? and state1=2 order by id desc`
|
|
|
|
+ cql := `select count(1) from seo_words.seo_resource where letter = ? and state1=2 `
|
|
|
|
+ offset := (pageNum - 1) * pageSize
|
|
|
|
+ sql += fmt.Sprintf(" limit %v,%v", offset, pageSize)
|
|
|
|
+ data := public.BaseMysql.SelectBySql(sql, letter)
|
|
|
|
+ count := public.BaseMysql.CountBySql(cql, letter)
|
|
|
|
+ if data != nil {
|
|
|
|
+ for _, v := range *data {
|
|
|
|
+ letter := qu.ObjToString(v["letter"])
|
|
|
|
+ id := qu.Int64All(v["id"])
|
|
|
|
+ name := qu.ObjToString(v["name"])
|
|
|
|
+ name += qu.ObjToString(config.Seoconfig["seoKeywordSuffix"])
|
|
|
|
+ m = append(m, map[string]interface{}{
|
|
|
|
+ "name": name,
|
|
|
|
+ "url": fmt.Sprintf("/tags/letter/all_all_all_%v_%v.html", letter, id),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return m, count
|
|
}
|
|
}
|
|
|
|
|
|
func (this *Tags) GetHotLabel(length int64) []map[string]interface{} {
|
|
func (this *Tags) GetHotLabel(length int64) []map[string]interface{} {
|
|
- rediskey := fmt.Sprintf("pcseo_getHotLabel_%v", length)
|
|
|
|
- if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
- return qu.ObjArrToMapArr(l)
|
|
|
|
- } else {
|
|
|
|
- m := []map[string]interface{}{}
|
|
|
|
- sql := `select id,name,letter from seo_words.seo_resource where state=1`
|
|
|
|
- cql := `select count(1) from seo_words.seo_resource where state=1`
|
|
|
|
- count := public.BaseMysql.CountBySql(cql)
|
|
|
|
- rand.Seed(time.Now().UnixNano())
|
|
|
|
- offset := rand.Intn(int(count / length))
|
|
|
|
- sql += fmt.Sprintf(" limit %v,%v", offset, length)
|
|
|
|
- data := public.BaseMysql.SelectBySql(sql)
|
|
|
|
- if data != nil {
|
|
|
|
- for _, v := range *data {
|
|
|
|
- letter := qu.ObjToString(v["letter"])
|
|
|
|
- id := qu.Int64All(v["id"])
|
|
|
|
- name := qu.ObjToString(v["name"])
|
|
|
|
- name += qu.ObjToString(config.Seoconfig["seoKeywordSuffix"])
|
|
|
|
- m = append(m, map[string]interface{}{
|
|
|
|
- "name": name,
|
|
|
|
- "url": fmt.Sprintf("/tags/letter/all_all_all_%v_%v.html", letter, id),
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- redis.Put("seoCache", rediskey, m, cacheTime)
|
|
|
|
- return m
|
|
|
|
- }
|
|
|
|
- return nil
|
|
|
|
|
|
+ rediskey := fmt.Sprintf("pcseo_getHotLabel_%v", length)
|
|
|
|
+ if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
|
|
+ return qu.ObjArrToMapArr(l)
|
|
|
|
+ } else {
|
|
|
|
+ m := []map[string]interface{}{}
|
|
|
|
+ sql := `select id,name,letter from seo_words.seo_resource where state1=2`
|
|
|
|
+ cql := `select count(1) from seo_words.seo_resource where state1=2`
|
|
|
|
+ count := public.BaseMysql.CountBySql(cql)
|
|
|
|
+ rand.Seed(time.Now().UnixNano())
|
|
|
|
+ offset := rand.Intn(int(count / length))
|
|
|
|
+ sql += fmt.Sprintf(" limit %v,%v", offset, length)
|
|
|
|
+ data := public.BaseMysql.SelectBySql(sql)
|
|
|
|
+ if data != nil {
|
|
|
|
+ for _, v := range *data {
|
|
|
|
+ letter := qu.ObjToString(v["letter"])
|
|
|
|
+ id := qu.Int64All(v["id"])
|
|
|
|
+ name := qu.ObjToString(v["name"])
|
|
|
|
+ name += qu.ObjToString(config.Seoconfig["seoKeywordSuffix"])
|
|
|
|
+ m = append(m, map[string]interface{}{
|
|
|
|
+ "name": name,
|
|
|
|
+ "url": fmt.Sprintf("/tags/letter/all_all_all_%v_%v.html", letter, id),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ redis.Put("seoCache", rediskey, m, cacheTime)
|
|
|
|
+ return m
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
}
|
|
}
|
|
|
|
|
|
// 获取招标平台类型
|
|
// 获取招标平台类型
|
|
func GetBiddingPlatformType() (nameToCode map[string]int64, codeToName map[int64]string) {
|
|
func GetBiddingPlatformType() (nameToCode map[string]int64, codeToName map[int64]string) {
|
|
- nameToCode = map[string]int64{}
|
|
|
|
- codeToName = map[int64]string{}
|
|
|
|
- data := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_site`)
|
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
|
- for _, v := range *data {
|
|
|
|
- name := qu.ObjToString(v["name"])
|
|
|
|
- id := qu.Int64All(v["id"])
|
|
|
|
- nameToCode[name] = id
|
|
|
|
- codeToName[id] = name
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
|
|
+ nameToCode = map[string]int64{}
|
|
|
|
+ codeToName = map[int64]string{}
|
|
|
|
+ data := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_site`)
|
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
|
+ for _, v := range *data {
|
|
|
|
+ name := qu.ObjToString(v["name"])
|
|
|
|
+ id := qu.Int64All(v["id"])
|
|
|
|
+ nameToCode[name] = id
|
|
|
|
+ codeToName[id] = name
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
|
|
// -2 等待池已满
|
|
// -2 等待池已满
|
|
// -1 超时
|
|
// -1 超时
|
|
// 1:可以执行查询
|
|
// 1:可以执行查询
|
|
func (r *reqLimit) Limit(ctx context.Context) int {
|
|
func (r *reqLimit) Limit(ctx context.Context) int {
|
|
- ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
|
|
|
|
- defer cancel()
|
|
|
|
- select {
|
|
|
|
- case <-r.waitPool:
|
|
|
|
- defer func() {
|
|
|
|
- r.waitPool <- struct{}{}
|
|
|
|
- }()
|
|
|
|
- select {
|
|
|
|
- case <-r.doPool:
|
|
|
|
- return 1
|
|
|
|
- case <-ctx.Done(): //超时
|
|
|
|
- return -1
|
|
|
|
- }
|
|
|
|
- default:
|
|
|
|
- return -2
|
|
|
|
- }
|
|
|
|
|
|
+ ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
|
|
|
|
+ defer cancel()
|
|
|
|
+ select {
|
|
|
|
+ case <-r.waitPool:
|
|
|
|
+ defer func() {
|
|
|
|
+ r.waitPool <- struct{}{}
|
|
|
|
+ }()
|
|
|
|
+ select {
|
|
|
|
+ case <-r.doPool:
|
|
|
|
+ return 1
|
|
|
|
+ case <-ctx.Done(): //超时
|
|
|
|
+ return -1
|
|
|
|
+ }
|
|
|
|
+ default:
|
|
|
|
+ return -2
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
func (r *reqLimit) Release() {
|
|
func (r *reqLimit) Release() {
|
|
- r.doPool <- struct{}{}
|
|
|
|
|
|
+ r.doPool <- struct{}{}
|
|
}
|
|
}
|
|
|
|
|
|
// GetBidding
|
|
// GetBidding
|
|
// 金额限制在"1000"~"100000000";需求因es压力过大,只返回60%的数据
|
|
// 金额限制在"1000"~"100000000";需求因es压力过大,只返回60%的数据
|
|
func (this *Tags) GetBidding(industry, area, city, stype, keyword string, request *http.Request, responseWriter http.ResponseWriter, session *httpsession.Session) ([]map[string]interface{}, int64, bool) {
|
|
func (this *Tags) GetBidding(industry, area, city, stype, keyword string, request *http.Request, responseWriter http.ResponseWriter, session *httpsession.Session) ([]map[string]interface{}, int64, bool) {
|
|
- rediskey := fmt.Sprintf("pcseo_getbidding_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
|
|
|
|
- rediskeyCount := fmt.Sprintf("pcseo_getbidding_count_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
|
|
|
|
-
|
|
|
|
- if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil {
|
|
|
|
- count := redis.GetInt("seoCache", rediskeyCount)
|
|
|
|
- return qu.ObjArrToMapArr(l), int64(count), false
|
|
|
|
- } else {
|
|
|
|
- if area != "" || stype != "" || industry != "" || city != "" || keyword != "" {
|
|
|
|
- if flag := reqLimitInit.Limit(context.Background()); flag == 1 {
|
|
|
|
- defer reqLimitInit.Release()
|
|
|
|
- } else {
|
|
|
|
- if flag == -2 {
|
|
|
|
- log.Println("等待队列已满")
|
|
|
|
- } else if flag == -1 {
|
|
|
|
- log.Println("等待超时")
|
|
|
|
- }
|
|
|
|
- return nil, 0, true
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if public.Lst.IsLimited(request, responseWriter, session, false) == 1 { //没有被限制
|
|
|
|
- defer public.Lst.Limit()
|
|
|
|
- } else {
|
|
|
|
- return nil, 0, true
|
|
|
|
- }
|
|
|
|
- now := time.Now()
|
|
|
|
- starttime := fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
|
|
|
|
- endtime := fmt.Sprint(now.Unix())
|
|
|
|
- var datas *[]map[string]interface{}
|
|
|
|
- //var startPage int
|
|
|
|
- var count int64
|
|
|
|
- //currentPage := 5
|
|
|
|
- limitCount := qu.IntAllDef(config.Seoconfig["tagsLimitCount"], 50)
|
|
|
|
- if keyword == "" {
|
|
|
|
- query := bidsearch.GetSearchQuery("", industry, "0.1", "1000", "", "", "", "", bidsearch.GetBidSearchQuery(area, city, fmt.Sprintf("%s_%s", starttime, endtime), stype, "", ""), "", false, seoBidField)
|
|
|
|
- //count = elastic.Count(INDEX, TYPE, query)
|
|
|
|
- //if count == 0 {
|
|
|
|
- // return nil, 0, false
|
|
|
|
- //}
|
|
|
|
- //startPage = rand.New(rand.NewSource(time.Now().UnixNano())).Intn(currentPage * limitCount)
|
|
|
|
- //count1 := qu.IntAll(count)
|
|
|
|
- //if count1 < startPage || startPage < 0 {
|
|
|
|
- // startPage = 0
|
|
|
|
- //}
|
|
|
|
- var countTmp int
|
|
|
|
- datas, countTmp = elastic.GetOAPage(INDEX, TYPE, query, bidSearch_sort, seoBidField, 0, limitCount)
|
|
|
|
- count = qu.Int64All(countTmp)
|
|
|
|
- if count == 0 {
|
|
|
|
- return nil, 0, false
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- count, _, datas = bidsearch.GetPcBidSearchData(keyword, area, city, fmt.Sprintf("%s_%s", starttime, endtime), stype, industry, "0.1", "1000", "", "", "", "", "", 0, true, []string{"title", "detail", "purchasing"}, seoBidField, "", false, false, "", limitCount, "")
|
|
|
|
- if datas != nil && len(*datas) > limitCount {
|
|
|
|
- *datas = (*datas)[0:limitCount]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if datas != nil && len(*datas) > 0 {
|
|
|
|
- for _, v := range *datas {
|
|
|
|
- v["_id"] = encrypt.CommonEncodeArticle("content", qu.ObjToString(v["_id"]))
|
|
|
|
- v["date"] = time.Unix(qu.Int64All(v["publishtime"]), 0).Format(date.Date_Short_Layout)
|
|
|
|
- highlight, _ := v["highlight"].(map[string][]string)
|
|
|
|
- detail := ""
|
|
|
|
- for _, val := range highlight["detail"] {
|
|
|
|
- detail += public.ClearHtml.ReplaceAllString(val, "")
|
|
|
|
- }
|
|
|
|
- if detail != "" {
|
|
|
|
- v["detail"] = detail
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if strings.Contains(industry, "_") {
|
|
|
|
- industry = strings.Split(industry, "_")[0]
|
|
|
|
- }
|
|
|
|
- public.BidListConvert(industry, datas)
|
|
|
|
- redis.Put("seoCache", rediskey, datas, cacheTime) //生产环境配置4G单独redis,超出4G自动清除
|
|
|
|
- redis.Put("seoCache", rediskeyCount, count, cacheTime) //生产环境配置4G单独redis,超出4G自动清除
|
|
|
|
- return *datas, count, false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return nil, 0, false
|
|
|
|
|
|
+ rediskey := fmt.Sprintf("pcseo_getbidding_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
|
|
|
|
+ rediskeyCount := fmt.Sprintf("pcseo_getbidding_count_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
|
|
|
|
+
|
|
|
|
+ if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil {
|
|
|
|
+ count := redis.GetInt("seoCache", rediskeyCount)
|
|
|
|
+ return qu.ObjArrToMapArr(l), int64(count), false
|
|
|
|
+ } else {
|
|
|
|
+ if area != "" || stype != "" || industry != "" || city != "" || keyword != "" {
|
|
|
|
+ if flag := reqLimitInit.Limit(context.Background()); flag == 1 {
|
|
|
|
+ defer reqLimitInit.Release()
|
|
|
|
+ } else {
|
|
|
|
+ if flag == -2 {
|
|
|
|
+ log.Println("等待队列已满")
|
|
|
|
+ } else if flag == -1 {
|
|
|
|
+ log.Println("等待超时")
|
|
|
|
+ }
|
|
|
|
+ return nil, 0, true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if public.Lst.IsLimited(request, responseWriter, session, false) == 1 { //没有被限制
|
|
|
|
+ defer public.Lst.Limit()
|
|
|
|
+ } else {
|
|
|
|
+ return nil, 0, true
|
|
|
|
+ }
|
|
|
|
+ now := time.Now()
|
|
|
|
+ starttime := fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
|
|
|
|
+ endtime := fmt.Sprint(now.Unix())
|
|
|
|
+ var datas *[]map[string]interface{}
|
|
|
|
+ //var startPage int
|
|
|
|
+ var count int64
|
|
|
|
+ //currentPage := 5
|
|
|
|
+ limitCount := qu.IntAllDef(config.Seoconfig["tagsLimitCount"], 50)
|
|
|
|
+ if keyword == "" {
|
|
|
|
+ query := bidsearch.GetSearchQuery("", industry, "0.1", "1000", "", "", "", "", bidsearch.GetBidSearchQuery(area, city, fmt.Sprintf("%s_%s", starttime, endtime), stype, "", ""), "", false, seoBidField)
|
|
|
|
+ //count = elastic.Count(INDEX, TYPE, query)
|
|
|
|
+ //if count == 0 {
|
|
|
|
+ // return nil, 0, false
|
|
|
|
+ //}
|
|
|
|
+ //startPage = rand.New(rand.NewSource(time.Now().UnixNano())).Intn(currentPage * limitCount)
|
|
|
|
+ //count1 := qu.IntAll(count)
|
|
|
|
+ //if count1 < startPage || startPage < 0 {
|
|
|
|
+ // startPage = 0
|
|
|
|
+ //}
|
|
|
|
+ var countTmp int
|
|
|
|
+ datas, countTmp = elastic.GetOAPage(INDEX, TYPE, query, bidSearch_sort, seoBidField, 0, limitCount)
|
|
|
|
+ count = qu.Int64All(countTmp)
|
|
|
|
+ if count == 0 {
|
|
|
|
+ return nil, 0, false
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ count, _, datas = bidsearch.GetPcBidSearchData(keyword, area, city, fmt.Sprintf("%s_%s", starttime, endtime), stype, industry, "", "", "", "", "", "", "", 0, true, []string{"title", "detail", "purchasing"}, seoBidField, "", false, false, "", limitCount, "")
|
|
|
|
+ if datas != nil && len(*datas) > limitCount {
|
|
|
|
+ *datas = (*datas)[0:limitCount]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if datas != nil && len(*datas) > 0 {
|
|
|
|
+ for _, v := range *datas {
|
|
|
|
+ v["_id"] = encrypt.CommonEncodeArticle("content", qu.ObjToString(v["_id"]))
|
|
|
|
+ v["date"] = time.Unix(qu.Int64All(v["publishtime"]), 0).Format(date.Date_Short_Layout)
|
|
|
|
+ highlight, _ := v["highlight"].(map[string][]string)
|
|
|
|
+ detail := ""
|
|
|
|
+ for _, val := range highlight["detail"] {
|
|
|
|
+ detail += public.ClearHtml.ReplaceAllString(val, "")
|
|
|
|
+ }
|
|
|
|
+ if detail != "" {
|
|
|
|
+ v["detail"] = detail
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(industry, "_") {
|
|
|
|
+ industry = strings.Split(industry, "_")[0]
|
|
|
|
+ }
|
|
|
|
+ public.BidListConvert(industry, datas)
|
|
|
|
+ redis.Put("seoCache", rediskey, datas, cacheTime) //生产环境配置4G单独redis,超出4G自动清除
|
|
|
|
+ redis.Put("seoCache", rediskeyCount, count, cacheTime) //生产环境配置4G单独redis,超出4G自动清除
|
|
|
|
+ return *datas, count, false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return nil, 0, false
|
|
}
|
|
}
|
|
|
|
|
|
// 获取关键词
|
|
// 获取关键词
|
|
func (this *Tags) GetSeoKeyWords(id string) (string, string) {
|
|
func (this *Tags) GetSeoKeyWords(id string) (string, string) {
|
|
- i_id, _ := strconv.Atoi(id)
|
|
|
|
- data := public.BaseMysql.SelectBySql(`select name from seo_words.seo_resource where id=? limit 1`, i_id)
|
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
|
- name := qu.ObjToString((*data)[0]["name"])
|
|
|
|
- return name, qu.ObjToString(config.Seoconfig["seoKeywordSuffix"])
|
|
|
|
- }
|
|
|
|
- return "", ""
|
|
|
|
|
|
+ i_id, _ := strconv.Atoi(id)
|
|
|
|
+ data := public.BaseMysql.SelectBySql(`select name from seo_words.seo_resource where id=? limit 1`, i_id)
|
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
|
+ name := qu.ObjToString((*data)[0]["name"])
|
|
|
|
+ return name, qu.ObjToString(config.Seoconfig["seoKeywordSuffix"])
|
|
|
|
+ }
|
|
|
|
+ return "", ""
|
|
}
|
|
}
|
|
|
|
|
|
// 获取行业分类下的标签
|
|
// 获取行业分类下的标签
|
|
func (this *Tags) GetInsturyKeywords(idstr string) (name, class_1, class_2 string) {
|
|
func (this *Tags) GetInsturyKeywords(idstr string) (name, class_1, class_2 string) {
|
|
- id, _ := strconv.Atoi(idstr)
|
|
|
|
- data := public.BaseMysql.SelectBySql(`select id,class_1,class_2,name from seo_words.seo_industry where id =?`, id)
|
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
|
- for _, v := range *data {
|
|
|
|
- class_1 = qu.ObjToString(v["class_1"])
|
|
|
|
- name = qu.ObjToString(v["name"])
|
|
|
|
- class_2 = qu.ObjToString(v["class_2"])
|
|
|
|
- return name, class_1, class_2
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return "", "", ""
|
|
|
|
|
|
+ id, _ := strconv.Atoi(idstr)
|
|
|
|
+ data := public.BaseMysql.SelectBySql(`select id,class_1,class_2,name from seo_words.seo_industry where id =?`, id)
|
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
|
+ for _, v := range *data {
|
|
|
|
+ class_1 = qu.ObjToString(v["class_1"])
|
|
|
|
+ name = qu.ObjToString(v["name"])
|
|
|
|
+ class_2 = qu.ObjToString(v["class_2"])
|
|
|
|
+ return name, class_1, class_2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return "", "", ""
|
|
}
|
|
}
|
|
|
|
|
|
// 获取信息类型 【全部是虚假的全部、实则是不包含拟建和采购意向的全部】
|
|
// 获取信息类型 【全部是虚假的全部、实则是不包含拟建和采购意向的全部】
|
|
// p353包含采购意向与拟建
|
|
// p353包含采购意向与拟建
|
|
|
|
+// p397 不包含拟建
|
|
func (this *Tags) GetInfoType(idstr string) (string, string) {
|
|
func (this *Tags) GetInfoType(idstr string) (string, string) {
|
|
- if idstr == "all" {
|
|
|
|
- return "拟建,招标,邀标,询价,竞谈,单一,竞价,变更,中标,成交,废标,流标,合同,验收,违规,预告,需求公示,预审,论证意见,预审结果", ""
|
|
|
|
- //return "", ""
|
|
|
|
- }
|
|
|
|
- id, _ := strconv.Atoi(idstr)
|
|
|
|
- data := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_stype where id =?`, id)
|
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
|
- for _, v := range *data {
|
|
|
|
- name := qu.ObjToString(v["name"])
|
|
|
|
- return getstype(name), name
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return "", ""
|
|
|
|
|
|
+ if idstr == "all" {
|
|
|
|
+ return "招标,邀标,询价,竞谈,单一,竞价,变更,中标,成交,废标,流标,合同,验收,违规,预告,需求公示,预审,论证意见,预审结果", ""
|
|
|
|
+ //return "", ""
|
|
|
|
+ }
|
|
|
|
+ id, _ := strconv.Atoi(idstr)
|
|
|
|
+ data := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_stype where id =?`, id)
|
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
|
+ for _, v := range *data {
|
|
|
|
+ name := qu.ObjToString(v["name"])
|
|
|
|
+ return getstype(name), name
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return "", ""
|
|
}
|
|
}
|
|
|
|
|
|
// this.T["letterList"],this.T["letterListCount"],this.T["pagingMap"]=this.GetLetterPaging(pageNum,checkedLetter)
|
|
// this.T["letterList"],this.T["letterListCount"],this.T["pagingMap"]=this.GetLetterPaging(pageNum,checkedLetter)
|
|
func (this *Tags) GetLetterPaging(pageNum int, checkedLetter string) (letterList []map[string]interface{}, letterListCount int64, pagingMap map[string]interface{}) {
|
|
func (this *Tags) GetLetterPaging(pageNum int, checkedLetter string) (letterList []map[string]interface{}, letterListCount int64, pagingMap map[string]interface{}) {
|
|
- seoLetterPageSize := qu.Int64All(config.Seoconfig["seoLetterPageSize"])
|
|
|
|
- if pageNum == 0 {
|
|
|
|
- pageNum = 1
|
|
|
|
- }
|
|
|
|
- letterList, letterListCount = this.GetLetterMap(seoLetterPageSize, int64(pageNum), checkedLetter)
|
|
|
|
- pagecount := int(math.Ceil(qu.Float64All(letterListCount) / float64(seoLetterPageSize)))
|
|
|
|
- paging := paging.PaggingHtml(pageNum, pagecount, fmt.Sprintf("/tags/letter/%s", checkedLetter)+"_%v.html")
|
|
|
|
-
|
|
|
|
- pagingMap = map[string]interface{}{
|
|
|
|
- "paging": paging,
|
|
|
|
- "pageNum": pageNum,
|
|
|
|
- "pageCount": pagecount,
|
|
|
|
- "pageSize": seoLetterPageSize,
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
|
|
+ seoLetterPageSize := qu.Int64All(config.Seoconfig["seoLetterPageSize"])
|
|
|
|
+ if pageNum == 0 {
|
|
|
|
+ pageNum = 1
|
|
|
|
+ }
|
|
|
|
+ letterList, letterListCount = this.GetLetterMap(seoLetterPageSize, int64(pageNum), checkedLetter)
|
|
|
|
+ pagecount := int(math.Ceil(qu.Float64All(letterListCount) / float64(seoLetterPageSize)))
|
|
|
|
+ paging := paging.PaggingHtml(pageNum, pagecount, fmt.Sprintf("/tags/letter/%s", checkedLetter)+"_%v.html")
|
|
|
|
+
|
|
|
|
+ pagingMap = map[string]interface{}{
|
|
|
|
+ "paging": paging,
|
|
|
|
+ "pageNum": pageNum,
|
|
|
|
+ "pageCount": pagecount,
|
|
|
|
+ "pageSize": seoLetterPageSize,
|
|
|
|
+ }
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
|
|
// itype 1:汇总页 2:标签页
|
|
// itype 1:汇总页 2:标签页
|
|
// stype area:地区 industy:行业 letter:字母类
|
|
// stype area:地区 industy:行业 letter:字母类
|
|
func (this *Tags) GetTDK(isDetails bool, stype string, keywords string, pagenum int, letter string, industryWord string, areaWord, letterWord, infoType string) map[string]interface{} {
|
|
func (this *Tags) GetTDK(isDetails bool, stype string, keywords string, pagenum int, letter string, industryWord string, areaWord, letterWord, infoType string) map[string]interface{} {
|
|
- title, keywordsContent, descriptionContent := "", "", ""
|
|
|
|
- if !isDetails {
|
|
|
|
- //汇总页
|
|
|
|
- if stype == "area" {
|
|
|
|
- title = fmt.Sprintf("%s招标采购网站大全-剑鱼标讯", areaWord)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s招标采购网站、%s政府采购中心、%s工程交易中心、%s公共资源交易网", areaWord, areaWord, areaWord, areaWord)
|
|
|
|
- descriptionContent = "剑鱼标讯提供全国各省市区县的招标采购网站大全,覆盖省市招标网、政府采购网、公共资源交易网、招投标交易中心、政府采购中心、工程交易中心、公共资源交易中心等招标平台。通过专业可靠的招投标服务,赋能企业"
|
|
|
|
- } else if stype == "industry" {
|
|
|
|
- title = fmt.Sprintf("%s招标采购行业大全-剑鱼标讯", areaWord)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s招标采购分类,%s招标行业分类,%s招标采购行业,%s招标采购信息", areaWord, areaWord, areaWord, areaWord)
|
|
|
|
- descriptionContent = "剑鱼标讯提供全国各行各业的招标采购公告、预告、变更、中标等招标分类信息搜索、查看、发布服务。有详细的招标采购信息、政府采购信息、标书制作、招投标课程、企业合作需求等招标分类信息。借助高流量的主站使信息推广变得更加简单,快速,效率。"
|
|
|
|
- } else if stype == "letter" {
|
|
|
|
- title = fmt.Sprintf("热门招标采购关键词%s类-剑鱼标讯", letter)
|
|
|
|
- if pagenum != 1 && pagenum != 0 {
|
|
|
|
- title = fmt.Sprintf("热门招标采购关键词%s类第%v页-剑鱼标讯", letter, pagenum)
|
|
|
|
- }
|
|
|
|
- keywordsContent = fmt.Sprintf("热门招标采购关键词%s类", letter)
|
|
|
|
- descriptionContent = fmt.Sprintf("剑鱼标讯招标采购热门关键词%s类为您提供全国各行业招标,采购,中标,商机供应信息,各类建筑建设工程项目标讯数据,全面、及时、专业、可靠的招标采购信息就用剑鱼标讯。", letter)
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- //标签页
|
|
|
|
- if stype == "area" {
|
|
|
|
- title = fmt.Sprintf("%s-招标采购信息", areaWord)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s,%s招标,%s采购", areaWord, areaWord, areaWord)
|
|
|
|
- descriptionContent = fmt.Sprintf("提供%s全部招标采购信息,登录后可以免费查看,涵盖%s拟建项目、采购意向、招标公告,中标结果等招投标信息。%s为您提供专业全面的招投标服务!", areaWord, areaWord, areaWord)
|
|
|
|
- } else if stype == "industry" {
|
|
|
|
- if infoType == "招标预告" {
|
|
|
|
- title = fmt.Sprintf("%s免费招标预告_%s采购信息预告-剑鱼标讯", industryWord, keywords)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s免费招标预告,%s招投标预告,%s采购预告", industryWord, industryWord, industryWord)
|
|
|
|
- descriptionContent = fmt.Sprintf("剑鱼标讯%s招标信息预告专栏,免费提供%s招标采购预告信息,寻找优质免费%s招标预告信息网站,就用剑鱼标讯!", industryWord, industryWord, industryWord)
|
|
|
|
- } else if infoType == "招标公告" {
|
|
|
|
- title = fmt.Sprintf("%s免费招标公告_%s采购信息公告-剑鱼标讯", industryWord, keywords)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s免费招标公告,%s招投标公告,%s采购公告", industryWord, industryWord, industryWord)
|
|
|
|
- descriptionContent = fmt.Sprintf("剑鱼标讯%s招标信息公告专栏,免费提供%s招标采购公告信息,寻找优质免费%s招标公告信息网站,就用剑鱼标讯!", industryWord, industryWord, industryWord)
|
|
|
|
- } else if infoType == "招标结果" {
|
|
|
|
- title = fmt.Sprintf("%s免费招标结果_%s采购信息结果-剑鱼标讯", industryWord, keywords)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s免费招标结果,%s招投标结果,%s采购结果", industryWord, industryWord, industryWord)
|
|
|
|
- descriptionContent = fmt.Sprintf("剑鱼标讯%s招标结果专栏,免费提供%s招标采购结果内容,寻找优质免费%s招标结果信息网站,就用剑鱼标讯!", industryWord, industryWord, industryWord)
|
|
|
|
- } else if infoType == "招标信用信息" {
|
|
|
|
- title = fmt.Sprintf("%s招标采购信用信息查询网-剑鱼标讯", industryWord)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s招标信用,%s投标信用,%s采购信用查询", industryWord, industryWord, industryWord)
|
|
|
|
- descriptionContent = fmt.Sprintf("剑鱼标讯%s招标信息查询专栏,免费提供%s招标信息查询内容,寻找优质免费%s招标信用查询网站,就用剑鱼标讯!", industryWord, industryWord, industryWord)
|
|
|
|
- } else {
|
|
|
|
- title = fmt.Sprintf("%s免费招标信息_%s采购服务平台-剑鱼标讯", industryWord, keywords)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s免费招标信息,%s招标公告,%s中标公告,%s招标采购,%s招标网", industryWord, industryWord, industryWord, industryWord, industryWord)
|
|
|
|
- descriptionContent = fmt.Sprintf("剑鱼标讯%s专栏,是%s招标采购的免费信息平台,免费提供%s招标采购信息、招标公告,中标结果等所有%s相关的招投标信息,寻找优质免费%s招标信息网站,就用剑鱼标讯!", industryWord, industryWord, industryWord, industryWord, industryWord)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else if stype == "letter" {
|
|
|
|
- title = fmt.Sprintf("%s免费招标信息_%s采购平台-剑鱼标讯", letterWord, letterWord)
|
|
|
|
- keywordsContent = fmt.Sprintf("%s免费招标信息,%s招标公告,%s中标公告,%s招标采购,%s招标网", letterWord, letterWord, letterWord, letterWord, letterWord)
|
|
|
|
- descriptionContent = fmt.Sprintf("剑鱼标讯%s专栏,是%s招标采购的免费信息平台,免费提供全国%s招标采购信息、招标公告、中标结果等所有%s相关的招投标信息,寻找优质免费%s招标信息网站,就用剑鱼标讯!", letterWord, letterWord, letterWord, letterWord, letterWord)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return map[string]interface{}{
|
|
|
|
- "title": title,
|
|
|
|
- "keywordsContent": keywordsContent,
|
|
|
|
- "descriptionContent": descriptionContent,
|
|
|
|
- }
|
|
|
|
|
|
+ title, keywordsContent, descriptionContent := "", "", ""
|
|
|
|
+ if !isDetails {
|
|
|
|
+ //汇总页
|
|
|
|
+ if stype == "area" {
|
|
|
|
+ title = fmt.Sprintf("%s招标采购网站大全-剑鱼标讯", areaWord)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s招标采购网站、%s政府采购中心、%s工程交易中心、%s公共资源交易网", areaWord, areaWord, areaWord, areaWord)
|
|
|
|
+ descriptionContent = "剑鱼标讯提供全国各省市区县的招标采购网站大全,覆盖省市招标网、政府采购网、公共资源交易网、招投标交易中心、政府采购中心、工程交易中心、公共资源交易中心等招标平台。通过专业可靠的招投标服务,赋能企业"
|
|
|
|
+ } else if stype == "industry" {
|
|
|
|
+ title = fmt.Sprintf("%s招标采购行业大全-剑鱼标讯", areaWord)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s招标采购分类,%s招标行业分类,%s招标采购行业,%s招标采购信息", areaWord, areaWord, areaWord, areaWord)
|
|
|
|
+ descriptionContent = "剑鱼标讯提供全国各行各业的招标采购公告、预告、变更、中标等招标分类信息搜索、查看、发布服务。有详细的招标采购信息、政府采购信息、标书制作、招投标课程、企业合作需求等招标分类信息。借助高流量的主站使信息推广变得更加简单,快速,效率。"
|
|
|
|
+ } else if stype == "letter" {
|
|
|
|
+ title = fmt.Sprintf("热门招标采购关键词%s类-剑鱼标讯", letter)
|
|
|
|
+ if pagenum != 1 && pagenum != 0 {
|
|
|
|
+ title = fmt.Sprintf("热门招标采购关键词%s类第%v页-剑鱼标讯", letter, pagenum)
|
|
|
|
+ }
|
|
|
|
+ keywordsContent = fmt.Sprintf("热门招标采购关键词%s类", letter)
|
|
|
|
+ descriptionContent = fmt.Sprintf("剑鱼标讯招标采购热门关键词%s类为您提供全国各行业招标,采购,中标,商机供应信息,各类建筑建设工程项目标讯数据,全面、及时、专业、可靠的招标采购信息就用剑鱼标讯。", letter)
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //标签页
|
|
|
|
+ if stype == "area" {
|
|
|
|
+ title = fmt.Sprintf("%s-招标采购信息", areaWord)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s,%s招标,%s采购", areaWord, areaWord, areaWord)
|
|
|
|
+ descriptionContent = fmt.Sprintf("提供%s全部招标采购信息,登录后可以免费查看,涵盖%s拟建项目、采购意向、招标公告,中标结果等招投标信息。%s为您提供专业全面的招投标服务!", areaWord, areaWord, areaWord)
|
|
|
|
+ } else if stype == "industry" {
|
|
|
|
+ if infoType == "招标预告" {
|
|
|
|
+ title = fmt.Sprintf("%s免费招标预告_%s采购信息预告-剑鱼标讯", industryWord, keywords)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s免费招标预告,%s招投标预告,%s采购预告", industryWord, industryWord, industryWord)
|
|
|
|
+ descriptionContent = fmt.Sprintf("剑鱼标讯%s招标信息预告专栏,免费提供%s招标采购预告信息,寻找优质免费%s招标预告信息网站,就用剑鱼标讯!", industryWord, industryWord, industryWord)
|
|
|
|
+ } else if infoType == "招标公告" {
|
|
|
|
+ title = fmt.Sprintf("%s免费招标公告_%s采购信息公告-剑鱼标讯", industryWord, keywords)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s免费招标公告,%s招投标公告,%s采购公告", industryWord, industryWord, industryWord)
|
|
|
|
+ descriptionContent = fmt.Sprintf("剑鱼标讯%s招标信息公告专栏,免费提供%s招标采购公告信息,寻找优质免费%s招标公告信息网站,就用剑鱼标讯!", industryWord, industryWord, industryWord)
|
|
|
|
+ } else if infoType == "招标结果" {
|
|
|
|
+ title = fmt.Sprintf("%s免费招标结果_%s采购信息结果-剑鱼标讯", industryWord, keywords)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s免费招标结果,%s招投标结果,%s采购结果", industryWord, industryWord, industryWord)
|
|
|
|
+ descriptionContent = fmt.Sprintf("剑鱼标讯%s招标结果专栏,免费提供%s招标采购结果内容,寻找优质免费%s招标结果信息网站,就用剑鱼标讯!", industryWord, industryWord, industryWord)
|
|
|
|
+ } else if infoType == "招标信用信息" {
|
|
|
|
+ title = fmt.Sprintf("%s招标采购信用信息查询网-剑鱼标讯", industryWord)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s招标信用,%s投标信用,%s采购信用查询", industryWord, industryWord, industryWord)
|
|
|
|
+ descriptionContent = fmt.Sprintf("剑鱼标讯%s招标信息查询专栏,免费提供%s招标信息查询内容,寻找优质免费%s招标信用查询网站,就用剑鱼标讯!", industryWord, industryWord, industryWord)
|
|
|
|
+ } else {
|
|
|
|
+ title = fmt.Sprintf("%s免费招标信息_%s采购服务平台-剑鱼标讯", industryWord, keywords)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s免费招标信息,%s招标公告,%s中标公告,%s招标采购,%s招标网", industryWord, industryWord, industryWord, industryWord, industryWord)
|
|
|
|
+ descriptionContent = fmt.Sprintf("剑鱼标讯%s专栏,是%s招标采购的免费信息平台,免费提供%s招标采购信息、招标公告,中标结果等所有%s相关的招投标信息,寻找优质免费%s招标信息网站,就用剑鱼标讯!", industryWord, industryWord, industryWord, industryWord, industryWord)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else if stype == "letter" {
|
|
|
|
+ title = fmt.Sprintf("%s免费招标信息_%s采购平台-剑鱼标讯", letterWord, letterWord)
|
|
|
|
+ keywordsContent = fmt.Sprintf("%s免费招标信息,%s招标公告,%s中标公告,%s招标采购,%s招标网", letterWord, letterWord, letterWord, letterWord, letterWord)
|
|
|
|
+ descriptionContent = fmt.Sprintf("剑鱼标讯%s专栏,是%s招标采购的免费信息平台,免费提供全国%s招标采购信息、招标公告、中标结果等所有%s相关的招投标信息,寻找优质免费%s招标信息网站,就用剑鱼标讯!", letterWord, letterWord, letterWord, letterWord, letterWord)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return map[string]interface{}{
|
|
|
|
+ "title": title,
|
|
|
|
+ "keywordsContent": keywordsContent,
|
|
|
|
+ "descriptionContent": descriptionContent,
|
|
|
|
+ }
|
|
}
|
|
}
|