|
@@ -49,12 +49,17 @@ type (
|
|
|
city string
|
|
|
district string
|
|
|
}
|
|
|
+ keyFw struct {
|
|
|
+ code string
|
|
|
+ keyword string
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
siteCodeMap map[string]*KeyWordSiteNode
|
|
|
specialArea = map[string]bool{"北京": true, "上海": true, "天津": true, "重庆": true}
|
|
|
KeyBiddingAreaMap []keyBidding
|
|
|
+ KeyFwArr []keyFw
|
|
|
)
|
|
|
|
|
|
func init() {
|
|
@@ -84,6 +89,16 @@ func init() {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ 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() {
|
|
|
+ KeyFwArr = append(KeyFwArr, keyFw{
|
|
|
+ keyword: gconv.String(m["keyword"]),
|
|
|
+ code: gconv.String(m["id"]),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 政府招标
|
|
@@ -390,3 +405,28 @@ func PurchasingData() []map[string]interface{} {
|
|
|
|
|
|
return keyWords
|
|
|
}
|
|
|
+
|
|
|
+// ServiceProcurement 服务类采购
|
|
|
+func ServiceProcurement(number int) []argument {
|
|
|
+ redisKey := "ServiceProcurement"
|
|
|
+ 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(KeyFwArr), number) {
|
|
|
+ acronym := KeyFwArr[i2]
|
|
|
+ data = append(data, argument{
|
|
|
+ acronym.keyword,
|
|
|
+ fmt.Sprintf("/fuwu/fw%03s.html", acronym.code),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ redis.Put(RedisNameNew, redisKey, data, RedisTimeout)
|
|
|
+ return data
|
|
|
+}
|