|
@@ -9,6 +9,7 @@ import (
|
|
"log"
|
|
"log"
|
|
"math"
|
|
"math"
|
|
"math/rand"
|
|
"math/rand"
|
|
|
|
+ "net/http"
|
|
qu "qfw/util"
|
|
qu "qfw/util"
|
|
"qfw/util/bidsearch"
|
|
"qfw/util/bidsearch"
|
|
"qfw/util/elastic"
|
|
"qfw/util/elastic"
|
|
@@ -17,6 +18,7 @@ import (
|
|
"strings"
|
|
"strings"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
+ "github.com/go-xweb/httpsession"
|
|
"github.com/go-xweb/xweb"
|
|
"github.com/go-xweb/xweb"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -229,7 +231,12 @@ func (this *Tags) Index(types, name string) {
|
|
this.T["tdk"] = this.GetTDK(haveList, types, checkedKeywords, pageNum, checkedLetter, qu.ObjToString(this.T["area"])+checkedKeywords+infotypeStr, qu.ObjToString(this.T["area"])+checkedKeywords+infotypeStr, checkedKeywords)
|
|
this.T["tdk"] = this.GetTDK(haveList, types, checkedKeywords, pageNum, checkedLetter, qu.ObjToString(this.T["area"])+checkedKeywords+infotypeStr, qu.ObjToString(this.T["area"])+checkedKeywords+infotypeStr, checkedKeywords)
|
|
if haveList {
|
|
if haveList {
|
|
//信息类型
|
|
//信息类型
|
|
- this.T["biddingList"], this.T["biddingCount"] = this.GetBidding(checkedIndustry, checkedProvince, checkedCity, InfoType, checkedKeywords)
|
|
|
|
|
|
+ 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"]
|
|
filters["biddingCount"] = this.T["biddingCount"]
|
|
if qu.Int64All(this.T["biddingCount"]) == 0 && types == "letter" {
|
|
if qu.Int64All(this.T["biddingCount"]) == 0 && types == "letter" {
|
|
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)
|
|
@@ -583,15 +590,20 @@ func GetBiddingPlatformType() (nameToCode map[string]int64, codeToName map[int64
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-func (this *Tags) GetBidding(industry, area, city, stype, keyword string) ([]map[string]interface{}, int64) {
|
|
|
|
|
|
+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)
|
|
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)
|
|
rediskeyCount := fmt.Sprintf("pcseo_getbidding_count_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
|
|
|
|
|
|
if l, ok := redis.Get("other", rediskey).([]interface{}); ok && l != nil {
|
|
if l, ok := redis.Get("other", rediskey).([]interface{}); ok && l != nil {
|
|
count := redis.GetInt("other", rediskeyCount)
|
|
count := redis.GetInt("other", rediskeyCount)
|
|
- return qu.ObjArrToMapArr(l), int64(count)
|
|
|
|
|
|
+ return qu.ObjArrToMapArr(l), int64(count), false
|
|
} else {
|
|
} else {
|
|
if area != "" || stype != "" || industry != "" || city != "" || keyword != "" {
|
|
if area != "" || stype != "" || industry != "" || city != "" || keyword != "" {
|
|
|
|
+ if public.Lst.IsLimited(request, responseWriter, session, false) == 1 { //没有被限制
|
|
|
|
+ defer public.Lst.Limit()
|
|
|
|
+ } else {
|
|
|
|
+ return nil, 0, true
|
|
|
|
+ }
|
|
//
|
|
//
|
|
query1 := `{"query": {"bool": {"must":[`
|
|
query1 := `{"query": {"bool": {"must":[`
|
|
query_start := `{"query": {"bool": {"must":[`
|
|
query_start := `{"query": {"bool": {"must":[`
|
|
@@ -664,11 +676,11 @@ func (this *Tags) GetBidding(industry, area, city, stype, keyword string) ([]map
|
|
public.BidListConvert(industry, datas)
|
|
public.BidListConvert(industry, datas)
|
|
redis.Put("other", rediskey, datas, 2*60*60)
|
|
redis.Put("other", rediskey, datas, 2*60*60)
|
|
redis.Put("other", rediskeyCount, count, 2*60*60)
|
|
redis.Put("other", rediskeyCount, count, 2*60*60)
|
|
- return *datas, count
|
|
|
|
|
|
+ return *datas, count, false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return nil, 0
|
|
|
|
|
|
+ return nil, 0, false
|
|
}
|
|
}
|
|
|
|
|
|
//获取关键词
|
|
//获取关键词
|