|
@@ -388,313 +388,9 @@ func (p *Pcsearch) SearchPower(module string) {
|
|
|
// PcSearchIndex 路由搜索
|
|
|
func (p *Pcsearch) PcSearchIndex(module string) error {
|
|
|
defer util.Catch()
|
|
|
- //页面重构后 前端中转页 P480#2
|
|
|
- //if !strings.Contains(p.Request.URL.String(), "useOld") {
|
|
|
- return p.Render("/pc/search/index.html", &p.T)
|
|
|
- //}
|
|
|
sessVal := p.Session().GetMultiple()
|
|
|
- p.T["logid"] = config.Seoconfig["jysslby"].(string)
|
|
|
- pageSize, _ := p.GetInteger("pageSize")
|
|
|
- if pageSize == 0 {
|
|
|
- pageSize = 50
|
|
|
- }
|
|
|
- accountId := util.Int64All(sessVal["accountId"])
|
|
|
- entAccountId := util.Int64All(sessVal["entAccountId"])
|
|
|
- entId := util.Int64All(sessVal["entId"])
|
|
|
- entUserId := util.Int64All(sessVal["entUserId"])
|
|
|
- keywords := p.GetString("keywords")
|
|
|
- industry := strings.TrimSpace(p.GetString("industry")) //选中的行业
|
|
|
- area := p.GetString("area") //地区
|
|
|
- publishtime := p.GetString("publishtime") //发布时间
|
|
|
- timeslot := p.GetString("timeslot") //显示选择时间
|
|
|
- toptype := p.GetString("toptype") //信息类型
|
|
|
- subtype := p.GetString("subtype") //信息类型
|
|
|
- minprice := p.GetString("minprice") //最低价格
|
|
|
- maxprice := p.GetString("maxprice") //最高价格
|
|
|
- fileExists := p.GetString("fileExists") //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
|
|
|
- //搜索优化P260--start--
|
|
|
- searchGroup, _ := p.GetInteger("searchGroup") //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
|
|
|
- searchMode, _ := p.GetInteger("searchMode") //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
|
|
|
- wordsMode, _ := p.GetInteger("wordsMode") //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
|
|
|
- additionalWords := p.GetString("additionalWords") //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
|
|
|
- //--end--
|
|
|
- //userId, _ := p.GetSession("userId").(string)
|
|
|
- //phone, _ := p.GetSession("phone").(string)
|
|
|
userId := util.ObjToString(sessVal["userId"])
|
|
|
- phone := util.ObjToString(sessVal["phone"])
|
|
|
- selectType := p.GetString("selectType") //搜索范围
|
|
|
- if selectType == "" {
|
|
|
- selectType = "title,content"
|
|
|
- }
|
|
|
- //p353包含采购意向与拟建
|
|
|
- noLoginBl := false
|
|
|
- if userId == "" {
|
|
|
- //未登录用户访问全部信息类型 需要过滤掉 拟建
|
|
|
- // p397 未登录用户收回查看拟建权限
|
|
|
- if searchGroup < 2 {
|
|
|
- if strings.Contains(subtype, "采购意向") || strings.Contains(subtype, "拟建") {
|
|
|
- var ss []string
|
|
|
- for _, v := range strings.Split(subtype, ",") {
|
|
|
- if v != "采购意向" && !strings.Contains(v, "拟建") {
|
|
|
- ss = append(ss, v)
|
|
|
- }
|
|
|
- }
|
|
|
- subtype = strings.Join(ss, ",")
|
|
|
- }
|
|
|
- if subtype == "" {
|
|
|
- subtype = "招标预告,招标公告,招标结果,招标信用信息"
|
|
|
- noLoginBl = true
|
|
|
- }
|
|
|
- }
|
|
|
- //未登录用户搜索范围 标题和 正文
|
|
|
- var selectTypeArr []string
|
|
|
- selectTypeSplit := strings.Split(selectType, ",")
|
|
|
- // 未登录用户只能搜标题和正文
|
|
|
- for i := 0; i < len(selectTypeSplit); i++ {
|
|
|
- if selectTypeSplit[i] == "title" || selectTypeSplit[i] == "content" {
|
|
|
- selectTypeArr = append(selectTypeArr, selectTypeSplit[i])
|
|
|
- }
|
|
|
- }
|
|
|
- if len(selectTypeArr) > 0 {
|
|
|
- selectType = strings.Join(selectTypeArr, ",")
|
|
|
- }
|
|
|
- if publishtime != "" {
|
|
|
- publishtime = ""
|
|
|
- }
|
|
|
- }
|
|
|
- //高级筛选 仅vip用户可查询
|
|
|
- var (
|
|
|
- hasBuyerTel, hasWinnerTel = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
|
|
|
- buyerclass = "" //采购单位类别
|
|
|
- notkey = "" //排除词
|
|
|
- city = "" //城市 付费用户可用
|
|
|
- district = ""
|
|
|
- regionMap = ""
|
|
|
- buyer = ""
|
|
|
- winner = ""
|
|
|
- agency = ""
|
|
|
- mobileTag []string //P513中国移动定制招标采购搜索
|
|
|
- )
|
|
|
- // 领域化标识
|
|
|
- territorialization := p.GetString("bid_field")
|
|
|
- switch module {
|
|
|
- case "medical": // 领域类型 医疗-0101
|
|
|
- if territorialization == "" {
|
|
|
- territorialization = "0101"
|
|
|
- }
|
|
|
- case "BIProperty":
|
|
|
- territorialization = territorialization
|
|
|
- default:
|
|
|
- territorialization = ""
|
|
|
- }
|
|
|
- if territorialization == "" {
|
|
|
- territorialization = p.GetString("property")
|
|
|
- }
|
|
|
- userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
|
|
|
- queryItems := userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
|
- isPayedUser := userInfo.IsPayedUser()
|
|
|
- if isPayedUser {
|
|
|
- buyerclass = p.GetString("buyerclass")
|
|
|
- hasBuyerTel, hasWinnerTel = p.GetString("buyertel"), p.GetString("winnertel")
|
|
|
- notkey = p.GetString("notkey")
|
|
|
- city = p.GetString("city") //城市 付费用户可用
|
|
|
- district = p.GetString("district")
|
|
|
- regionMap = p.GetString("regionMap")
|
|
|
- //P492招标采购搜索匹配采购单位等优化
|
|
|
- buyer = p.GetString("buyer") //采购单位
|
|
|
- winner = p.GetString("winner") //中标企业
|
|
|
- agency = p.GetString("agency") //招标代理机构
|
|
|
- }
|
|
|
- //历史导出数据回显
|
|
|
- if strings.Contains(p.Url(), "?goback") {
|
|
|
- keywords = util.ObjToString(sessVal["Echo_keywords"])
|
|
|
- publishtime = util.ObjToString(sessVal["Echo_publishtime"])
|
|
|
- area = util.ObjToString(sessVal["Echo_area"])
|
|
|
- subtype = util.ObjToString(sessVal["Echo_subtype"])
|
|
|
- minprice = util.ObjToString(sessVal["Echo_minprice"])
|
|
|
- maxprice = util.ObjToString(sessVal["Echo_maxprice"])
|
|
|
- buyerclass = util.ObjToString(sessVal["Echo_buyerclass"])
|
|
|
- selectType = util.ObjToString(sessVal["Echo_selectType"])
|
|
|
- timeslot = util.ObjToString(sessVal["Echo_timeslot"])
|
|
|
- hasBuyerTel = util.ObjToString(sessVal["Echo_hasBuyertel"])
|
|
|
- hasWinnerTel = util.ObjToString(sessVal["Echo_hasWinnertel"])
|
|
|
- industry = util.ObjToString(sessVal["Echo_industry"])
|
|
|
- notkey = util.ObjToString(sessVal["Echo_notkey"])
|
|
|
- fileExists = util.ObjToString(sessVal["Echo_fileExists"])
|
|
|
- city = util.ObjToString(sessVal["Echo_city"])
|
|
|
- district = util.ObjToString(sessVal["Echo_district"])
|
|
|
- regionMap = util.ObjToString(sessVal["Echo_regionMap"])
|
|
|
- bidField = util.ObjToString(sessVal["Echo_bid_field"]) // 领域化数据 0101-医疗行业
|
|
|
- territorialization = util.ObjToString(sessVal["Echo_bid_field"]) // 领域化数据 0101-医疗行业
|
|
|
- searchGroup = util.IntAll(sessVal["Echo_searchGroup"]) //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
|
|
|
- searchMode = util.IntAll(sessVal["Echo_searchMode"]) //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
|
|
|
- wordsMode = util.IntAll(sessVal["Echo_wordsMode"]) //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
|
|
|
- additionalWords = util.ObjToString(sessVal["Echo_additionalWords"]) //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
|
|
|
- queryItems = userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
|
- //P492招标采购搜索匹配采购单位等优化
|
|
|
- buyer = util.ObjToString(sessVal["Echo_buyer"])
|
|
|
- winner = util.ObjToString(sessVal["Echo_winner"])
|
|
|
- agency = util.ObjToString(sessVal["Echo_agency"])
|
|
|
- }
|
|
|
- keywordsLimit := util.IntAllDef(config.Sysconfig["keywordsLimit"], 35)
|
|
|
- searchLimit := public.IsSearchLimit(queryItems)
|
|
|
- //-----------------------------未登录用户支持非单字符查询--------------------------
|
|
|
- if userId == "" {
|
|
|
- keywordsLimit = util.IntAllDef(config.Sysconfig["keywordsLimitNologin"], 25)
|
|
|
- //未登录用户标题、正文都限制,已登录用户只限制正文
|
|
|
- searchLimit = true
|
|
|
- if len([]rune(keywords)) == 1 {
|
|
|
- //未登录用户搜索不让搜索单字
|
|
|
- keywords = ""
|
|
|
- }
|
|
|
- }
|
|
|
- var (
|
|
|
- list []*map[string]interface{}
|
|
|
- count, total, bCount int64
|
|
|
- secondFlag = ""
|
|
|
- isSearch = true
|
|
|
- b_word, a_word, s_word, heightKeys = "", "", "", ""
|
|
|
- )
|
|
|
- onList, _ := jyutil.IsOnTheWhitelist(p.Session())
|
|
|
- if keywords != "" {
|
|
|
- // p329 非白名单用户 处理通用词
|
|
|
- if !onList && len(industry) == 0 {
|
|
|
- keywords = jyutil.FilterGeneric(keywords) // 关键词处理通用词
|
|
|
- additionalWords = jyutil.AdditionalFilterGeneric(additionalWords) // 附加词处理通用词
|
|
|
- }
|
|
|
- b_word, a_word, s_word = jy.InterceptSearchKW(keywords, keywordsLimit, len(industry) == 0)
|
|
|
- }
|
|
|
- if strings.Index(p.Refer(), "/page_workDesktop/work-bench") > -1 {
|
|
|
- //超级搜索页面 移动定制搜索标签(仅工作台内展示)
|
|
|
- mobileTag = p.GetSlice("mobileTag[]")
|
|
|
- //if len(mobileTag) > 0 { //当无该权限,把此字段置空
|
|
|
- if !jy.HasBidFieldPower(config.Middleground, p.Session(), MobileTagSearchFunctionCode) {
|
|
|
- mobileTag = []string{}
|
|
|
- } else if (len(mobileTag) > 0 && mobileTag[0] == "all") || len(mobileTag) == 0 {
|
|
|
- mobileTag = mobileTagItemsValOptionsAll
|
|
|
- }
|
|
|
- //}
|
|
|
- }
|
|
|
-
|
|
|
- //医疗领域化信息 用户前提是大会员 超级订阅,才有领域化功能的权限
|
|
|
- if territorialization != "" && territorialization != "BIProperty" {
|
|
|
- isSearch = false
|
|
|
- userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
|
|
|
- if userInfo.BigMember > 0 || userInfo.VipState > 0 {
|
|
|
- if jy.HasBidFieldPower(config.Middleground, p.Session(), MedicalFunctionCode) {
|
|
|
- isSearch = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- isLimit := 1
|
|
|
- if isSearch {
|
|
|
- searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
|
|
|
- so := NewSearchOptimize(mobileTag, userId, phone, area, city, district, subtype, toptype, publishtime, strings.Join(queryItems, ","), fmt.Sprintf("%s-%s", minprice, maxprice), industry, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, s_word, additionalWords, notkey, "PC", territorialization, "", "", "",
|
|
|
- 0, pageSize, searchGroup, searchMode, wordsMode, "", "", 0, 0,
|
|
|
- *userInfo, searchTypeSwitch, p.Request, accountId, entAccountId, entId, entUserId, buyer, winner, agency)
|
|
|
- heightKeys = so.HeightKeys //主关键词和附加词合并,多组空格隔开,作为前端渲染高亮关键词使用
|
|
|
- //关键词 行业 附加词
|
|
|
- //放开用户不输入关键词可搜索 --P297需求
|
|
|
- // p329 反爬白名单用户放开 非反爬白名单用户不放开未输入关键词
|
|
|
- if len(s_word) > 0 || (len(s_word) == 0 && onList) || len(industry) > 0 || strings.TrimSpace(so.AdditionalWords) != "" || len(so.MobileTag) > 0 {
|
|
|
- if searchLimit {
|
|
|
- isLimit = public.Lst.IsLimited(p.Request, p.ResponseWriter, p.Session(), isPayedUser)
|
|
|
- if isLimit == 1 { //没有被限制
|
|
|
- defer public.Lst.Limit()
|
|
|
- }
|
|
|
- }
|
|
|
- if isLimit == 1 {
|
|
|
- count, total, list = so.GetBidSearchList(false)
|
|
|
- if total < util.Int64All(config.Sysconfig["precisionNum"]) && so.SearchMode == 0 && so.KeyWords != "" {
|
|
|
- soBlur := NewSearchOptimize(mobileTag, userId, phone, area, city, district, subtype, toptype, publishtime, strings.Join(queryItems, ","), fmt.Sprintf("%s-%s", minprice, maxprice), industry, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, s_word, additionalWords, notkey, "PC", territorialization, "", "", "",
|
|
|
- 0, pageSize, searchGroup, 1, wordsMode, "", "", 0, 0,
|
|
|
- *userInfo, searchTypeSwitch, p.Request, accountId, entAccountId, entId, entUserId, buyer, winner, agency)
|
|
|
- bCount = soBlur.FuzzySearchNumber()
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- p.DisableHttpCache()
|
|
|
- list, count, total = so.GetBidSearchListByCache()
|
|
|
- }
|
|
|
- }
|
|
|
- if noLoginBl {
|
|
|
- subtype = ""
|
|
|
- }
|
|
|
- if userId == "" {
|
|
|
- for _, v := range list {
|
|
|
- *v = SearchFilter(*v)
|
|
|
- }
|
|
|
- }
|
|
|
- p.T["bCount"] = bCount
|
|
|
- p.T["list"] = list
|
|
|
- p.T["secondFlag"] = secondFlag
|
|
|
- p.T["area"] = area
|
|
|
- p.T["publishtime"] = publishtime
|
|
|
- p.T["timeslot"] = timeslot
|
|
|
- p.T["toptype"] = toptype
|
|
|
- p.T["subtype"] = subtype
|
|
|
- p.T["searchvalue"] = keywords //搜索关键词
|
|
|
- p.T["minprice"] = minprice
|
|
|
- p.T["maxprice"] = maxprice
|
|
|
- p.T["buyerclass"] = buyerclass
|
|
|
- p.T["buyertel"] = hasBuyerTel
|
|
|
- p.T["winnertel"] = hasWinnerTel
|
|
|
- p.T["notkey"] = notkey
|
|
|
- p.T["fileExists"] = fileExists
|
|
|
- p.T["city"] = city
|
|
|
- p.T["district"] = district
|
|
|
- p.T["regionMap"] = regionMap
|
|
|
- p.T["bid_field"] = territorialization
|
|
|
- p.SetSession("paramkey", b_word)
|
|
|
- switch publishtime {
|
|
|
- case "lately-7":
|
|
|
- p.SetSession("parampublishtime", "最近7天")
|
|
|
- case "lately-30":
|
|
|
- p.SetSession("parampublishtime", "最近30天")
|
|
|
- case "thisyear":
|
|
|
- p.SetSession("parampublishtime", "近一年")
|
|
|
- case "threeyear":
|
|
|
- p.SetSession("parampublishtime", "近三年")
|
|
|
- case "fiveyear":
|
|
|
- p.SetSession("parampublishtime", "近五年")
|
|
|
- default:
|
|
|
- p.SetSession("parampublishtime", publishtime)
|
|
|
- }
|
|
|
- p.SetSession("paramarea", area)
|
|
|
- if subtype != "" {
|
|
|
- p.SetSession("paraminfotype", subtype)
|
|
|
- } else {
|
|
|
- p.SetSession("paraminfotype", toptype)
|
|
|
- }
|
|
|
- //}
|
|
|
- p.T["selectType"] = selectType
|
|
|
- p.T["login"] = p.Session().Get("user")
|
|
|
- p.T["count"] = count
|
|
|
- p.T["totalPage"] = (count + 1) / int64(pageSize)
|
|
|
- p.T["keywords"] = keywords //搜索关键词
|
|
|
- p.T["heightWords"] = heightKeys //主关键词和附加词合并后
|
|
|
- p.T["industry"] = industry
|
|
|
- p.T["industrylist"] = industrylist
|
|
|
- p.T["sortArray"] = sortArray
|
|
|
- p.T["showVipScreen"] = isPayedUser
|
|
|
- p.T["bidField"] = territorialization
|
|
|
- p.T["module"] = module
|
|
|
- p.T["interceptKeyWords"] = b_word //超出限制关键词限制长度 截取后
|
|
|
- p.T["interceptOtherWords"] = a_word //超出限制关键词限制长度 截取后 提示关键词
|
|
|
- p.T["interceptLimit"] = keywordsLimit
|
|
|
- //
|
|
|
- p.T["searchGroup"] = searchGroup
|
|
|
- p.T["searchMode"] = searchMode
|
|
|
- p.T["wordsMode"] = wordsMode
|
|
|
- p.T["additionalWords"] = additionalWords
|
|
|
- p.T["total"] = total
|
|
|
-
|
|
|
- p.T["isVip"] = userInfo.VipState > 0
|
|
|
- p.T["isMember"] = userInfo.BigMember > 0
|
|
|
- p.T["isEntniche"] = userInfo.EntMember > 0
|
|
|
- p.T["isEntnicheNew"] = userInfo.IsNewEnt
|
|
|
- p.T["isEntService"] = userInfo.EntService
|
|
|
- p.T["vipBefore202209"] = userInfo.VipState > 0 && userInfo.VipStartData < util.Int64All(config.Sysconfig["contextOldVipLimit"]) //超级订阅 超强项目
|
|
|
+ //页面重构后 前端中转页 P480#2
|
|
|
//
|
|
|
cooperateCode := ""
|
|
|
if userId != "" {
|
|
@@ -706,21 +402,338 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
|
|
|
}
|
|
|
}
|
|
|
p.T["cooperateCode"] = cooperateCode
|
|
|
- p.T["isLimit"] = isLimit
|
|
|
- if module == "supsearch" {
|
|
|
- p.T["simpleTemplateData"] = map[string]interface{}{
|
|
|
- "isEntniche": p.T["isEntniche"],
|
|
|
- "isVip": p.T["isVip"],
|
|
|
- "isMember": p.T["isMember"],
|
|
|
- "vipBefore202209": p.T["vipBefore202209"],
|
|
|
- "searchMode": searchMode,
|
|
|
- "searchvalue": keywords,
|
|
|
- "additionalWords": additionalWords,
|
|
|
- "listLength": util.If(list != nil, len(list), 0),
|
|
|
- }
|
|
|
- }
|
|
|
- //老版搜索页面
|
|
|
- return p.Render("/pc/supsearch.html", &p.T)
|
|
|
+ //if !strings.Contains(p.Request.URL.String(), "useOld") {
|
|
|
+ return p.Render("/pc/search/index.html", &p.T)
|
|
|
+ //}
|
|
|
+ //sessVal := p.Session().GetMultiple()
|
|
|
+ //p.T["logid"] = config.Seoconfig["jysslby"].(string)
|
|
|
+ //pageSize, _ := p.GetInteger("pageSize")
|
|
|
+ //if pageSize == 0 {
|
|
|
+ // pageSize = 50
|
|
|
+ //}
|
|
|
+ //accountId := util.Int64All(sessVal["accountId"])
|
|
|
+ //entAccountId := util.Int64All(sessVal["entAccountId"])
|
|
|
+ //entId := util.Int64All(sessVal["entId"])
|
|
|
+ //entUserId := util.Int64All(sessVal["entUserId"])
|
|
|
+ //keywords := p.GetString("keywords")
|
|
|
+ //industry := strings.TrimSpace(p.GetString("industry")) //选中的行业
|
|
|
+ //area := p.GetString("area") //地区
|
|
|
+ //publishtime := p.GetString("publishtime") //发布时间
|
|
|
+ //timeslot := p.GetString("timeslot") //显示选择时间
|
|
|
+ //toptype := p.GetString("toptype") //信息类型
|
|
|
+ //subtype := p.GetString("subtype") //信息类型
|
|
|
+ //minprice := p.GetString("minprice") //最低价格
|
|
|
+ //maxprice := p.GetString("maxprice") //最高价格
|
|
|
+ //fileExists := p.GetString("fileExists") //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
|
|
|
+ ////搜索优化P260--start--
|
|
|
+ //searchGroup, _ := p.GetInteger("searchGroup") //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
|
|
|
+ //searchMode, _ := p.GetInteger("searchMode") //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
|
|
|
+ //wordsMode, _ := p.GetInteger("wordsMode") //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
|
|
|
+ //additionalWords := p.GetString("additionalWords") //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
|
|
|
+ ////--end--
|
|
|
+ ////userId, _ := p.GetSession("userId").(string)
|
|
|
+ ////phone, _ := p.GetSession("phone").(string)
|
|
|
+ //userId := util.ObjToString(sessVal["userId"])
|
|
|
+ //phone := util.ObjToString(sessVal["phone"])
|
|
|
+ //selectType := p.GetString("selectType") //搜索范围
|
|
|
+ //if selectType == "" {
|
|
|
+ // selectType = "title,content"
|
|
|
+ //}
|
|
|
+ ////p353包含采购意向与拟建
|
|
|
+ //noLoginBl := false
|
|
|
+ //if userId == "" {
|
|
|
+ // //未登录用户访问全部信息类型 需要过滤掉 拟建
|
|
|
+ // // p397 未登录用户收回查看拟建权限
|
|
|
+ // if searchGroup < 2 {
|
|
|
+ // if strings.Contains(subtype, "采购意向") || strings.Contains(subtype, "拟建") {
|
|
|
+ // var ss []string
|
|
|
+ // for _, v := range strings.Split(subtype, ",") {
|
|
|
+ // if v != "采购意向" && !strings.Contains(v, "拟建") {
|
|
|
+ // ss = append(ss, v)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // subtype = strings.Join(ss, ",")
|
|
|
+ // }
|
|
|
+ // if subtype == "" {
|
|
|
+ // subtype = "招标预告,招标公告,招标结果,招标信用信息"
|
|
|
+ // noLoginBl = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // //未登录用户搜索范围 标题和 正文
|
|
|
+ // var selectTypeArr []string
|
|
|
+ // selectTypeSplit := strings.Split(selectType, ",")
|
|
|
+ // // 未登录用户只能搜标题和正文
|
|
|
+ // for i := 0; i < len(selectTypeSplit); i++ {
|
|
|
+ // if selectTypeSplit[i] == "title" || selectTypeSplit[i] == "content" {
|
|
|
+ // selectTypeArr = append(selectTypeArr, selectTypeSplit[i])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if len(selectTypeArr) > 0 {
|
|
|
+ // selectType = strings.Join(selectTypeArr, ",")
|
|
|
+ // }
|
|
|
+ // if publishtime != "" {
|
|
|
+ // publishtime = ""
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ ////高级筛选 仅vip用户可查询
|
|
|
+ //var (
|
|
|
+ // hasBuyerTel, hasWinnerTel = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
|
|
|
+ // buyerclass = "" //采购单位类别
|
|
|
+ // notkey = "" //排除词
|
|
|
+ // city = "" //城市 付费用户可用
|
|
|
+ // district = ""
|
|
|
+ // regionMap = ""
|
|
|
+ // buyer = ""
|
|
|
+ // winner = ""
|
|
|
+ // agency = ""
|
|
|
+ // mobileTag []string //P513中国移动定制招标采购搜索
|
|
|
+ //)
|
|
|
+ //// 领域化标识
|
|
|
+ //territorialization := p.GetString("bid_field")
|
|
|
+ //switch module {
|
|
|
+ //case "medical": // 领域类型 医疗-0101
|
|
|
+ // if territorialization == "" {
|
|
|
+ // territorialization = "0101"
|
|
|
+ // }
|
|
|
+ //case "BIProperty":
|
|
|
+ // territorialization = territorialization
|
|
|
+ //default:
|
|
|
+ // territorialization = ""
|
|
|
+ //}
|
|
|
+ //if territorialization == "" {
|
|
|
+ // territorialization = p.GetString("property")
|
|
|
+ //}
|
|
|
+ //userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
|
|
|
+ //queryItems := userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
|
+ //isPayedUser := userInfo.IsPayedUser()
|
|
|
+ //if isPayedUser {
|
|
|
+ // buyerclass = p.GetString("buyerclass")
|
|
|
+ // hasBuyerTel, hasWinnerTel = p.GetString("buyertel"), p.GetString("winnertel")
|
|
|
+ // notkey = p.GetString("notkey")
|
|
|
+ // city = p.GetString("city") //城市 付费用户可用
|
|
|
+ // district = p.GetString("district")
|
|
|
+ // regionMap = p.GetString("regionMap")
|
|
|
+ // //P492招标采购搜索匹配采购单位等优化
|
|
|
+ // buyer = p.GetString("buyer") //采购单位
|
|
|
+ // winner = p.GetString("winner") //中标企业
|
|
|
+ // agency = p.GetString("agency") //招标代理机构
|
|
|
+ //}
|
|
|
+ ////历史导出数据回显
|
|
|
+ //if strings.Contains(p.Url(), "?goback") {
|
|
|
+ // keywords = util.ObjToString(sessVal["Echo_keywords"])
|
|
|
+ // publishtime = util.ObjToString(sessVal["Echo_publishtime"])
|
|
|
+ // area = util.ObjToString(sessVal["Echo_area"])
|
|
|
+ // subtype = util.ObjToString(sessVal["Echo_subtype"])
|
|
|
+ // minprice = util.ObjToString(sessVal["Echo_minprice"])
|
|
|
+ // maxprice = util.ObjToString(sessVal["Echo_maxprice"])
|
|
|
+ // buyerclass = util.ObjToString(sessVal["Echo_buyerclass"])
|
|
|
+ // selectType = util.ObjToString(sessVal["Echo_selectType"])
|
|
|
+ // timeslot = util.ObjToString(sessVal["Echo_timeslot"])
|
|
|
+ // hasBuyerTel = util.ObjToString(sessVal["Echo_hasBuyertel"])
|
|
|
+ // hasWinnerTel = util.ObjToString(sessVal["Echo_hasWinnertel"])
|
|
|
+ // industry = util.ObjToString(sessVal["Echo_industry"])
|
|
|
+ // notkey = util.ObjToString(sessVal["Echo_notkey"])
|
|
|
+ // fileExists = util.ObjToString(sessVal["Echo_fileExists"])
|
|
|
+ // city = util.ObjToString(sessVal["Echo_city"])
|
|
|
+ // district = util.ObjToString(sessVal["Echo_district"])
|
|
|
+ // regionMap = util.ObjToString(sessVal["Echo_regionMap"])
|
|
|
+ // bidField = util.ObjToString(sessVal["Echo_bid_field"]) // 领域化数据 0101-医疗行业
|
|
|
+ // territorialization = util.ObjToString(sessVal["Echo_bid_field"]) // 领域化数据 0101-医疗行业
|
|
|
+ // searchGroup = util.IntAll(sessVal["Echo_searchGroup"]) //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
|
|
|
+ // searchMode = util.IntAll(sessVal["Echo_searchMode"]) //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
|
|
|
+ // wordsMode = util.IntAll(sessVal["Echo_wordsMode"]) //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
|
|
|
+ // additionalWords = util.ObjToString(sessVal["Echo_additionalWords"]) //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
|
|
|
+ // queryItems = userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
|
+ // //P492招标采购搜索匹配采购单位等优化
|
|
|
+ // buyer = util.ObjToString(sessVal["Echo_buyer"])
|
|
|
+ // winner = util.ObjToString(sessVal["Echo_winner"])
|
|
|
+ // agency = util.ObjToString(sessVal["Echo_agency"])
|
|
|
+ //}
|
|
|
+ //keywordsLimit := util.IntAllDef(config.Sysconfig["keywordsLimit"], 35)
|
|
|
+ //searchLimit := public.IsSearchLimit(queryItems)
|
|
|
+ ////-----------------------------未登录用户支持非单字符查询--------------------------
|
|
|
+ //if userId == "" {
|
|
|
+ // keywordsLimit = util.IntAllDef(config.Sysconfig["keywordsLimitNologin"], 25)
|
|
|
+ // //未登录用户标题、正文都限制,已登录用户只限制正文
|
|
|
+ // searchLimit = true
|
|
|
+ // if len([]rune(keywords)) == 1 {
|
|
|
+ // //未登录用户搜索不让搜索单字
|
|
|
+ // keywords = ""
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //var (
|
|
|
+ // list []*map[string]interface{}
|
|
|
+ // count, total, bCount int64
|
|
|
+ // secondFlag = ""
|
|
|
+ // isSearch = true
|
|
|
+ // b_word, a_word, s_word, heightKeys = "", "", "", ""
|
|
|
+ //)
|
|
|
+ //onList, _ := jyutil.IsOnTheWhitelist(p.Session())
|
|
|
+ //if keywords != "" {
|
|
|
+ // // p329 非白名单用户 处理通用词
|
|
|
+ // if !onList && len(industry) == 0 {
|
|
|
+ // keywords = jyutil.FilterGeneric(keywords) // 关键词处理通用词
|
|
|
+ // additionalWords = jyutil.AdditionalFilterGeneric(additionalWords) // 附加词处理通用词
|
|
|
+ // }
|
|
|
+ // b_word, a_word, s_word = jy.InterceptSearchKW(keywords, keywordsLimit, len(industry) == 0)
|
|
|
+ //}
|
|
|
+ //if strings.Index(p.Refer(), "/page_workDesktop/work-bench") > -1 {
|
|
|
+ // //超级搜索页面 移动定制搜索标签(仅工作台内展示)
|
|
|
+ // mobileTag = p.GetSlice("mobileTag[]")
|
|
|
+ // //if len(mobileTag) > 0 { //当无该权限,把此字段置空
|
|
|
+ // if !jy.HasBidFieldPower(config.Middleground, p.Session(), MobileTagSearchFunctionCode) {
|
|
|
+ // mobileTag = []string{}
|
|
|
+ // } else if (len(mobileTag) > 0 && mobileTag[0] == "all") || len(mobileTag) == 0 {
|
|
|
+ // mobileTag = mobileTagItemsValOptionsAll
|
|
|
+ // }
|
|
|
+ // //}
|
|
|
+ //}
|
|
|
+ //
|
|
|
+ ////医疗领域化信息 用户前提是大会员 超级订阅,才有领域化功能的权限
|
|
|
+ //if territorialization != "" && territorialization != "BIProperty" {
|
|
|
+ // isSearch = false
|
|
|
+ // userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
|
|
|
+ // if userInfo.BigMember > 0 || userInfo.VipState > 0 {
|
|
|
+ // if jy.HasBidFieldPower(config.Middleground, p.Session(), MedicalFunctionCode) {
|
|
|
+ // isSearch = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //isLimit := 1
|
|
|
+ //if isSearch {
|
|
|
+ // searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
|
|
|
+ // so := NewSearchOptimize(mobileTag, userId, phone, area, city, district, subtype, toptype, publishtime, strings.Join(queryItems, ","), fmt.Sprintf("%s-%s", minprice, maxprice), industry, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, s_word, additionalWords, notkey, "PC", territorialization, "", "", "",
|
|
|
+ // 0, pageSize, searchGroup, searchMode, wordsMode, "", "", 0, 0,
|
|
|
+ // *userInfo, searchTypeSwitch, p.Request, accountId, entAccountId, entId, entUserId, buyer, winner, agency)
|
|
|
+ // heightKeys = so.HeightKeys //主关键词和附加词合并,多组空格隔开,作为前端渲染高亮关键词使用
|
|
|
+ // //关键词 行业 附加词
|
|
|
+ // //放开用户不输入关键词可搜索 --P297需求
|
|
|
+ // // p329 反爬白名单用户放开 非反爬白名单用户不放开未输入关键词
|
|
|
+ // if len(s_word) > 0 || (len(s_word) == 0 && onList) || len(industry) > 0 || strings.TrimSpace(so.AdditionalWords) != "" || len(so.MobileTag) > 0 {
|
|
|
+ // if searchLimit {
|
|
|
+ // isLimit = public.Lst.IsLimited(p.Request, p.ResponseWriter, p.Session(), isPayedUser)
|
|
|
+ // if isLimit == 1 { //没有被限制
|
|
|
+ // defer public.Lst.Limit()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if isLimit == 1 {
|
|
|
+ // count, total, list = so.GetBidSearchList(false)
|
|
|
+ // if total < util.Int64All(config.Sysconfig["precisionNum"]) && so.SearchMode == 0 && so.KeyWords != "" {
|
|
|
+ // soBlur := NewSearchOptimize(mobileTag, userId, phone, area, city, district, subtype, toptype, publishtime, strings.Join(queryItems, ","), fmt.Sprintf("%s-%s", minprice, maxprice), industry, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, s_word, additionalWords, notkey, "PC", territorialization, "", "", "",
|
|
|
+ // 0, pageSize, searchGroup, 1, wordsMode, "", "", 0, 0,
|
|
|
+ // *userInfo, searchTypeSwitch, p.Request, accountId, entAccountId, entId, entUserId, buyer, winner, agency)
|
|
|
+ // bCount = soBlur.FuzzySearchNumber()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // p.DisableHttpCache()
|
|
|
+ // list, count, total = so.GetBidSearchListByCache()
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //if noLoginBl {
|
|
|
+ // subtype = ""
|
|
|
+ //}
|
|
|
+ //if userId == "" {
|
|
|
+ // for _, v := range list {
|
|
|
+ // *v = SearchFilter(*v)
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //p.T["bCount"] = bCount
|
|
|
+ //p.T["list"] = list
|
|
|
+ //p.T["secondFlag"] = secondFlag
|
|
|
+ //p.T["area"] = area
|
|
|
+ //p.T["publishtime"] = publishtime
|
|
|
+ //p.T["timeslot"] = timeslot
|
|
|
+ //p.T["toptype"] = toptype
|
|
|
+ //p.T["subtype"] = subtype
|
|
|
+ //p.T["searchvalue"] = keywords //搜索关键词
|
|
|
+ //p.T["minprice"] = minprice
|
|
|
+ //p.T["maxprice"] = maxprice
|
|
|
+ //p.T["buyerclass"] = buyerclass
|
|
|
+ //p.T["buyertel"] = hasBuyerTel
|
|
|
+ //p.T["winnertel"] = hasWinnerTel
|
|
|
+ //p.T["notkey"] = notkey
|
|
|
+ //p.T["fileExists"] = fileExists
|
|
|
+ //p.T["city"] = city
|
|
|
+ //p.T["district"] = district
|
|
|
+ //p.T["regionMap"] = regionMap
|
|
|
+ //p.T["bid_field"] = territorialization
|
|
|
+ //p.SetSession("paramkey", b_word)
|
|
|
+ //switch publishtime {
|
|
|
+ //case "lately-7":
|
|
|
+ // p.SetSession("parampublishtime", "最近7天")
|
|
|
+ //case "lately-30":
|
|
|
+ // p.SetSession("parampublishtime", "最近30天")
|
|
|
+ //case "thisyear":
|
|
|
+ // p.SetSession("parampublishtime", "近一年")
|
|
|
+ //case "threeyear":
|
|
|
+ // p.SetSession("parampublishtime", "近三年")
|
|
|
+ //case "fiveyear":
|
|
|
+ // p.SetSession("parampublishtime", "近五年")
|
|
|
+ //default:
|
|
|
+ // p.SetSession("parampublishtime", publishtime)
|
|
|
+ //}
|
|
|
+ //p.SetSession("paramarea", area)
|
|
|
+ //if subtype != "" {
|
|
|
+ // p.SetSession("paraminfotype", subtype)
|
|
|
+ //} else {
|
|
|
+ // p.SetSession("paraminfotype", toptype)
|
|
|
+ //}
|
|
|
+ ////}
|
|
|
+ //p.T["selectType"] = selectType
|
|
|
+ //p.T["login"] = p.Session().Get("user")
|
|
|
+ //p.T["count"] = count
|
|
|
+ //p.T["totalPage"] = (count + 1) / int64(pageSize)
|
|
|
+ //p.T["keywords"] = keywords //搜索关键词
|
|
|
+ //p.T["heightWords"] = heightKeys //主关键词和附加词合并后
|
|
|
+ //p.T["industry"] = industry
|
|
|
+ //p.T["industrylist"] = industrylist
|
|
|
+ //p.T["sortArray"] = sortArray
|
|
|
+ //p.T["showVipScreen"] = isPayedUser
|
|
|
+ //p.T["bidField"] = territorialization
|
|
|
+ //p.T["module"] = module
|
|
|
+ //p.T["interceptKeyWords"] = b_word //超出限制关键词限制长度 截取后
|
|
|
+ //p.T["interceptOtherWords"] = a_word //超出限制关键词限制长度 截取后 提示关键词
|
|
|
+ //p.T["interceptLimit"] = keywordsLimit
|
|
|
+ ////
|
|
|
+ //p.T["searchGroup"] = searchGroup
|
|
|
+ //p.T["searchMode"] = searchMode
|
|
|
+ //p.T["wordsMode"] = wordsMode
|
|
|
+ //p.T["additionalWords"] = additionalWords
|
|
|
+ //p.T["total"] = total
|
|
|
+ //
|
|
|
+ //p.T["isVip"] = userInfo.VipState > 0
|
|
|
+ //p.T["isMember"] = userInfo.BigMember > 0
|
|
|
+ //p.T["isEntniche"] = userInfo.EntMember > 0
|
|
|
+ //p.T["isEntnicheNew"] = userInfo.IsNewEnt
|
|
|
+ //p.T["isEntService"] = userInfo.EntService
|
|
|
+ //p.T["vipBefore202209"] = userInfo.VipState > 0 && userInfo.VipStartData < util.Int64All(config.Sysconfig["contextOldVipLimit"]) //超级订阅 超强项目
|
|
|
+ ////
|
|
|
+ //cooperateCode := ""
|
|
|
+ //if userId != "" {
|
|
|
+ // //企业画像 权限
|
|
|
+ // p.T["portraitpower"] = jylabutil.IsAuthorized(userId, "i_portraitpower")
|
|
|
+ //} else {
|
|
|
+ // if cc, err := p.GetCookie(jy.ChannelCookieName); err == nil {
|
|
|
+ // cooperateCode = cc.Value
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //p.T["cooperateCode"] = cooperateCode
|
|
|
+ //p.T["isLimit"] = isLimit
|
|
|
+ //if module == "supsearch" {
|
|
|
+ // p.T["simpleTemplateData"] = map[string]interface{}{
|
|
|
+ // "isEntniche": p.T["isEntniche"],
|
|
|
+ // "isVip": p.T["isVip"],
|
|
|
+ // "isMember": p.T["isMember"],
|
|
|
+ // "vipBefore202209": p.T["vipBefore202209"],
|
|
|
+ // "searchMode": searchMode,
|
|
|
+ // "searchvalue": keywords,
|
|
|
+ // "additionalWords": additionalWords,
|
|
|
+ // "listLength": util.If(list != nil, len(list), 0),
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ ////老版搜索页面
|
|
|
+ //return p.Render("/pc/supsearch.html", &p.T)
|
|
|
}
|
|
|
|
|
|
// Newbids 最新招标信息 --已失效
|