|
@@ -61,6 +61,7 @@ var (
|
|
|
specialArea = map[string]bool{"北京": true, "上海": true, "天津": true, "重庆": true}
|
|
|
KeyBiddingAreaMap []keyBidding
|
|
|
KeyFwArr []keyFw
|
|
|
+ DistrictSArr []keyFw
|
|
|
)
|
|
|
|
|
|
func init() {
|
|
@@ -90,7 +91,15 @@ func init() {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ districtSData, err := g.DB().Query(gctx.New(), `SELECT site_code,keywords,alias FROM seo_siteKeywords_district where site_code = 1 `)
|
|
|
+ if err == nil && !districtSData.IsEmpty() {
|
|
|
+ for _, m := range districtSData.List() {
|
|
|
+ DistrictSArr = append(DistrictSArr, keyFw{
|
|
|
+ keyword: gconv.String(m["keywords"]),
|
|
|
+ code: fmt.Sprintf("%s_S%d", m["alias"], m["site_code"]),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
fwResArr, err := g.DB().Query(gctx.New(), `SELECT id, keyword FROM new_keyword_unified where unifiedSign = 'fw' and state = 1`)
|
|
|
if err == nil && !fwResArr.IsEmpty() {
|
|
|
for _, m := range fwResArr.List() {
|
|
@@ -201,6 +210,33 @@ func DistrictsTender(number int) []argument {
|
|
|
return data
|
|
|
}
|
|
|
|
|
|
+func DistrictsSList(number int) []argument {
|
|
|
+ redisKey := "districtsSList"
|
|
|
+ redisData := redis.Get(RedisNameNew, redisKey)
|
|
|
+ if redisData != nil {
|
|
|
+ if d, err := json.Marshal(redisData); err == nil {
|
|
|
+ var signature []argument
|
|
|
+ json.Unmarshal(d, &signature)
|
|
|
+ return signature
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var (
|
|
|
+ data []argument
|
|
|
+ )
|
|
|
+ for _, i2 := range jyutil.GenerateRandomNumber(0, len(DistrictSArr), number) {
|
|
|
+ acronym := DistrictSArr[i2]
|
|
|
+ data = append(data, argument{
|
|
|
+ acronym.keyword,
|
|
|
+ fmt.Sprintf("/list/city/%s.html", acronym.code),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if data != nil && len(data) > 0 {
|
|
|
+ redis.Put(RedisNameNew, redisKey, data, RedisTimeout)
|
|
|
+ }
|
|
|
+ return data
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
const (
|
|
|
PSearch_DecMust = `"bidstatus": ["中标","成交","合同","单一"]`
|