瀏覽代碼

Merge branch 'master' into release/v4.9.48

lianbingjie 1 年之前
父節點
當前提交
0eb1e43554

+ 40 - 0
src/jfw/front/dataServiceArea.go

@@ -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
+}

+ 2 - 0
src/jfw/front/index.go

@@ -267,6 +267,8 @@ func (nIndex *NewIndex) NewIndex() error {
 	nIndex.T["jySchool"] = jyutil.Course(6, 3)
 	// 政府招标
 	nIndex.T["governmentBidding"] = GovernmentTender(15)
+	// 服务类采购
+	nIndex.T["serviceProcurement"] = ServiceProcurement(15)
 	//区县招标
 	nIndex.T["districtsBidding"] = DistrictsTender(15)
 	nIndex.T["importBidding"] = GetImportBidding()

+ 1 - 1
src/jfw/modules/bigmember/src/entity/portrait.go

@@ -205,7 +205,7 @@ func CreateSubVipPortraitManagerForOpen(userid string, pageFlag, searchValue str
 		} else { //超级订阅升级版-校验超级订阅画像浏览次数
 			err := bigMsg.NewSubVipPortrait(db.Mysql, searchValue, isWinner).SubVipPortraitTimesCheck()
 			if err == nil {
-				return &Portrait{userid, session}, 2, nil, true
+				return &Portrait{userid, session}, 2, nil, free
 			} else {
 				log.Printf("用户%s 超级订阅使用画像%s次数异常 %v\n", userid, searchValue, err)
 			}

+ 6 - 0
src/web/templates/pc/template/index/important-gov-bidding.html

@@ -4,6 +4,7 @@
     <span class="i-g-card-header-tab" data-name="重点招标">重点招标</span>
     <span class="i-g-card-header-tab" data-name="地区招标">地区招标</span>
     <span class="i-g-card-header-tab" data-name="政府招标">政府招标</span>
+    <span class="i-g-card-header-tab" data-name="服务类采购">服务类采购</span>
   </header>
   <main class="module-card-content ent-list-module-content">
     <ul class="i-g-card-list clearfix">
@@ -22,6 +23,11 @@
         <a class="cms-link" href="{{$n.Url}}" title="{{$n.Name}}招标采购" target="_blank">{{$n.Name}}</a>
         {{end}}
       </li>
+      <li class="i-g-card-list-item" data-value="服务类采购" style="display: none;">
+        {{range $n := .T.serviceProcurement}}
+        <a class="cms-link" href="{{$n.Url}}" title="{{$n.Name}}采购" target="_blank">{{$n.Name}}</a>
+        {{end}}
+      </li>
     </ul>
   </main>
 </section>