|
@@ -855,7 +855,7 @@ func (m *Front) WxsearchlistPaging() {
|
|
if history == "" {
|
|
if history == "" {
|
|
arrs = make([]string, 0)
|
|
arrs = make([]string, 0)
|
|
}
|
|
}
|
|
- var historyFlag= 0
|
|
|
|
|
|
+ var historyFlag = 0
|
|
for _, v := range arrs {
|
|
for _, v := range arrs {
|
|
if v == strings.Trim(searchvalue, " ") {
|
|
if v == strings.Trim(searchvalue, " ") {
|
|
historyFlag = 1
|
|
historyFlag = 1
|
|
@@ -892,7 +892,6 @@ func (m *Front) WxsearchlistPaging() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
m.ServeJson(map[string]interface{}{
|
|
m.ServeJson(map[string]interface{}{
|
|
"list": list,
|
|
"list": list,
|
|
"hasNextPage": list != nil && len(*list) == wx_pageSize && pageNum < wx_maxPageNum,
|
|
"hasNextPage": list != nil && len(*list) == wx_pageSize && pageNum < wx_maxPageNum,
|
|
@@ -919,7 +918,7 @@ func (m *Front) DelWxHistorySearch() {
|
|
//微信端搜索
|
|
//微信端搜索
|
|
func getWxsearchlistData(keywords, searchvalue, scope, publishtime, subtype, industry string, pageNum int, selectType string) (list *[]map[string]interface{}) {
|
|
func getWxsearchlistData(keywords, searchvalue, scope, publishtime, subtype, industry string, pageNum int, selectType string) (list *[]map[string]interface{}) {
|
|
query := getBidSearchQuery(scope, publishtime, subtype, industry) //scope是地区对应传进的areas, stype是类型对应scope
|
|
query := getBidSearchQuery(scope, publishtime, subtype, industry) //scope是地区对应传进的areas, stype是类型对应scope
|
|
- fmt.Print("keywords>>>",keywords,"searchvalue>>",searchvalue)
|
|
|
|
|
|
+ fmt.Print("keywords>>>", keywords, "searchvalue>>", searchvalue)
|
|
if len(keywords) > 0 {
|
|
if len(keywords) > 0 {
|
|
if selectType == "all" { //全文搜索
|
|
if selectType == "all" { //全文搜索
|
|
list = elastic.GetByNgramOther(INDEX, TYPE, searchvalue, query, `"title","detail"`, bidSearch_sort, bidSearch_field_1, (pageNum-1)*wx_pageSize, wx_pageSize, true, false, 100)
|
|
list = elastic.GetByNgramOther(INDEX, TYPE, searchvalue, query, `"title","detail"`, bidSearch_sort, bidSearch_field_1, (pageNum-1)*wx_pageSize, wx_pageSize, true, false, 100)
|
|
@@ -1928,9 +1927,9 @@ func searchresulthtml(list *[]map[string]interface{}) string {
|
|
for i := 0; i < len(*list); i++ {
|
|
for i := 0; i < len(*list); i++ {
|
|
listdata := (*list)[i]
|
|
listdata := (*list)[i]
|
|
j = i + 1
|
|
j = i + 1
|
|
- listhtml += `<li><div>` + strconv.Itoa(j) + `.</div>`
|
|
|
|
|
|
+ listhtml += `<li><div class="liLuceneList"><div class="luce-left"><em>` + strconv.Itoa(j) + `.</em>`
|
|
if listdata["title"] != "" {
|
|
if listdata["title"] != "" {
|
|
- listhtml += `<div><a onclick="noIn(this)" dataId="` + util.EncodeArticleId2ByCheck(util.ObjToString(listdata["_id"])) + `" target="_blank">` + util.ObjToString(listdata["title"]) + `</a></div><div>`
|
|
|
|
|
|
+ listhtml += `<div class="left-title"><a onclick="noIn(this)" dataId="` + util.EncodeArticleId2ByCheck(util.ObjToString(listdata["_id"])) + `" target="_blank">` + util.ObjToString(listdata["title"]) + `</a></div></div><div class="luce-right">`
|
|
}
|
|
}
|
|
area, _ := listdata["area"].(string)
|
|
area, _ := listdata["area"].(string)
|
|
area = strings.TrimSpace(area)
|
|
area = strings.TrimSpace(area)
|
|
@@ -1950,19 +1949,29 @@ func searchresulthtml(list *[]map[string]interface{}) string {
|
|
}
|
|
}
|
|
stpadd, areaadd := classify(finalType, area)
|
|
stpadd, areaadd := classify(finalType, area)
|
|
if area != "" && area != "A" {
|
|
if area != "" && area != "A" {
|
|
- listhtml += `<span class="com-area"><a href="/list/area/` + areaadd + `.html">` + area + `</a></span>`
|
|
|
|
|
|
+ listhtml += `<a href="/list/area/` + areaadd + `.html">` + area + `</a>`
|
|
|
|
+ } else {
|
|
|
|
+ listhtml += `<a href="#" style="display:none;"></a>`
|
|
}
|
|
}
|
|
if finalType != "" {
|
|
if finalType != "" {
|
|
- listhtml += `<span class="com-type"><a href="/list/stype/` + stpadd + `.html">` + finalType + `</a></span>`
|
|
|
|
|
|
+ listhtml += `<a href="/list/stype/` + stpadd + `.html">` + finalType + `</a>`
|
|
|
|
+ } else {
|
|
|
|
+ listhtml += `<a href="#" style="display:none;"></a>`
|
|
|
|
+ }
|
|
|
|
+ industry, _ := listdata["industry"].(string)
|
|
|
|
+ if industry != "" {
|
|
|
|
+ listhtml += `<a href="javascript:volid(0);">` + industry + `</a>`
|
|
|
|
+ } else {
|
|
|
|
+ listhtml += `<a href="#" style="display:none;"></a>`
|
|
}
|
|
}
|
|
publishtime, _ := listdata["publishtime"].(float64)
|
|
publishtime, _ := listdata["publishtime"].(float64)
|
|
if publishtime != 0 {
|
|
if publishtime != 0 {
|
|
diff := util.TimeDiff(time.Unix(util.Int64All(publishtime), 0))
|
|
diff := util.TimeDiff(time.Unix(util.Int64All(publishtime), 0))
|
|
if diff != "" {
|
|
if diff != "" {
|
|
- listhtml += `<span class="com-time"><i class="glyphicon bofangjilu"></i>` + diff + `</span>`
|
|
|
|
|
|
+ listhtml += `<span class="com-time">` + diff + `</span>`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- listhtml += `</div></li>`
|
|
|
|
|
|
+ listhtml += `</div></div></li>`
|
|
}
|
|
}
|
|
return listhtml
|
|
return listhtml
|
|
}
|
|
}
|
|
@@ -1973,12 +1982,14 @@ func (f *Front) SearchResult(at, name string) error {
|
|
var no = 5
|
|
var no = 5
|
|
var area = ""
|
|
var area = ""
|
|
var stype = ""
|
|
var stype = ""
|
|
|
|
+ var industry = ""
|
|
var startPage, currentPage, limitcount int
|
|
var startPage, currentPage, limitcount int
|
|
limitcount = util.IntAll(config.Seoconfig["limitcount"])
|
|
limitcount = util.IntAll(config.Seoconfig["limitcount"])
|
|
var res = ""
|
|
var res = ""
|
|
var seotitle = ""
|
|
var seotitle = ""
|
|
var seokeywords = ""
|
|
var seokeywords = ""
|
|
var seodescription = ""
|
|
var seodescription = ""
|
|
|
|
+ f.T["industrylist"], f.T["sortArray"] = getindustrys()
|
|
var shareid = f.GetString("id")
|
|
var shareid = f.GetString("id")
|
|
if len(shareid) == 0 {
|
|
if len(shareid) == 0 {
|
|
shareid = fmt.Sprintf("%s%d", config.Seoconfig["jybqy"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
|
|
shareid = fmt.Sprintf("%s%d", config.Seoconfig["jybqy"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
|
|
@@ -2015,13 +2026,15 @@ func (f *Front) SearchResult(at, name string) error {
|
|
if area == "全国" {
|
|
if area == "全国" {
|
|
return f.Redirect("/swordfish/searchinfolist.html")
|
|
return f.Redirect("/swordfish/searchinfolist.html")
|
|
}
|
|
}
|
|
- if area != "" || stype != "" {
|
|
|
|
|
|
+ if area != "" || stype != "" || industry != "" {
|
|
list := redis.Get("other", "classify_"+name)
|
|
list := redis.Get("other", "classify_"+name)
|
|
query1 := `{"query": {"bool": {"must":[`
|
|
query1 := `{"query": {"bool": {"must":[`
|
|
if area != "" {
|
|
if area != "" {
|
|
query1 += `{"term":{"area":"` + area + `"}}`
|
|
query1 += `{"term":{"area":"` + area + `"}}`
|
|
} else if stype != "" {
|
|
} else if stype != "" {
|
|
query1 += `{"term":{"subtype":"` + stype + `"}}`
|
|
query1 += `{"term":{"subtype":"` + stype + `"}}`
|
|
|
|
+ } else if industry != "" {
|
|
|
|
+ query1 += `{"term":{"industry":"` + industry + `"}}`
|
|
}
|
|
}
|
|
query1 += `],"should": [],"minimum_should_match": 1}}}`
|
|
query1 += `],"should": [],"minimum_should_match": 1}}}`
|
|
query := getLastNewsQuery(area, "", stype)
|
|
query := getLastNewsQuery(area, "", stype)
|
|
@@ -2035,17 +2048,18 @@ func (f *Front) SearchResult(at, name string) error {
|
|
if count1 < startPage || startPage < 0 {
|
|
if count1 < startPage || startPage < 0 {
|
|
startPage = 0
|
|
startPage = 0
|
|
}
|
|
}
|
|
- datas = elastic.GetPage(INDEX, TYPE, query, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href"`, startPage, limitcount)
|
|
|
|
|
|
+ datas = elastic.GetPage(INDEX, TYPE, query, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","bidopentime","winner","agency","bidamount","budget","biddingcontent","projectname"`, startPage, limitcount)
|
|
redis.Put("other", "classify_"+name, datas, 2*60*60)
|
|
redis.Put("other", "classify_"+name, datas, 2*60*60)
|
|
} else {
|
|
} else {
|
|
b, _ := json.Marshal(list)
|
|
b, _ := json.Marshal(list)
|
|
json.Unmarshal(b, &datas)
|
|
json.Unmarshal(b, &datas)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ jyutil.BidListConvert(industry, datas)
|
|
res = searchresulthtml(datas)
|
|
res = searchresulthtml(datas)
|
|
f.T["res"] = res
|
|
f.T["res"] = res
|
|
f.T["area"] = area
|
|
f.T["area"] = area
|
|
f.T["stype"] = stype
|
|
f.T["stype"] = stype
|
|
|
|
+ f.T["classifyname"] = name
|
|
f.SetSession("paramarea", area)
|
|
f.SetSession("paramarea", area)
|
|
f.SetSession("paraminfotype", stype)
|
|
f.SetSession("paraminfotype", stype)
|
|
f.T["shareid"] = se.EncodeString(shareid)
|
|
f.T["shareid"] = se.EncodeString(shareid)
|
|
@@ -2053,6 +2067,19 @@ func (f *Front) SearchResult(at, name string) error {
|
|
return f.Render("/pc/classifylist.html", &f.T)
|
|
return f.Render("/pc/classifylist.html", &f.T)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//
|
|
|
|
+func (f *Front) GetClassifyList() error {
|
|
|
|
+ defer util.Catch()
|
|
|
|
+ //判断用户是否开启超级搜索?
|
|
|
|
+
|
|
|
|
+ classifyname := f.GetString("classifyname")
|
|
|
|
+ data := redis.Get("other", "classify_"+classifyname)
|
|
|
|
+ f.ServeJson(map[string]interface{}{
|
|
|
|
+ "data": data,
|
|
|
|
+ })
|
|
|
|
+ return nil
|
|
|
|
+}
|
|
|
|
+
|
|
//
|
|
//
|
|
func classify(stp, area string) (string, string) {
|
|
func classify(stp, area string) (string, string) {
|
|
var areas, _ = config.Seoconfig["area"].(map[string]interface{})
|
|
var areas, _ = config.Seoconfig["area"].(map[string]interface{})
|