ソースを参照

fix:无权益画像修改

duxin 1 年間 前
コミット
1b91ec3bc8

+ 3 - 2
entniche_new/src/config.json

@@ -57,6 +57,7 @@
     "华能信息技术有限公司",
     "浙江华数广电网络股份有限公司"
   ],
-  "portraitStartTime": 2018
-
+  "portraitStartTime": 2018,
+  "portraitDynamicTime": 7,
+  "portraitCount": 30
 }

+ 8 - 6
entniche_new/src/config/config.go

@@ -61,12 +61,14 @@ type config struct {
 		EnterpriseNumb int64
 		PersonalNumb   int64
 	} // 商机管理服务认领数量限制
-	OneAreaTimesBuyer  int
-	RecommendThreshold float32
-	Customers          []customerInfo
-	Entcustomer        []string
-	SearchPCount       int
-	PortraitStartTime  int `json:"portraitStartTime"`
+	OneAreaTimesBuyer   int
+	RecommendThreshold  float32
+	Customers           []customerInfo
+	Entcustomer         []string
+	SearchPCount        int
+	PortraitStartTime   int `json:"portraitStartTime"`
+	PortraitDynamicTime int `json:"portraitDynamicTime"`
+	PortraitCount       int `json:"portraitCount"`
 }
 
 type timeTaskConfig struct {

+ 7 - 5
entniche_new/src/entity/portrait_screen.go

@@ -324,9 +324,10 @@ func (pwp *PortraitProjectScreen) FreePortraitNews(mustQueryArr []string, isWinn
 	var dataArr []map[string]interface{}
 	if rBytes, err := redis.GetBytes("other", redisKey); err == nil && len(*rBytes) != 0 {
 		_ = json.Unmarshal(*rBytes, &redisData)
-		dataArr, _ = redisData["data"].([]map[string]interface{})
-		total, _ = redisData["total"].(int64)
-		updateTime, _ = redisData["updateTime"].(int64)
+		rData, _ := redisData["data"].([]interface{})
+		dataArr = qutil.ObjArrToMapArr(rData)
+		total = qutil.Int64All(redisData["total"])
+		updateTime = qutil.Int64All(redisData["updateTime"])
 	} else {
 		var fields string
 		updateTime = time.Now().Unix()
@@ -335,9 +336,10 @@ func (pwp *PortraitProjectScreen) FreePortraitNews(mustQueryArr []string, isWinn
 		} else {
 			fields = `"bidstatus","_id","title","subtype","projectname","publishtime","area","bidamount","budget","bidopentime","s_winner","entidlist"`
 		}
-		listQuery := fmt.Sprintf(NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(`,"_source":[%s],"sort":{%s},"from":0,"size":30`, fields, `"publishtime":"desc","id":"desc"`))
-		total = elastic.Count(biddingIndex, biddingIndex, listQuery)
+		mustQueryArrStr := strings.Join(mustQueryArr, ",")
+		total = elastic.Count(biddingIndex, biddingIndex, fmt.Sprintf(NewMustSearch, mustQueryArrStr, ""))
 		if total > 0 {
+			listQuery := fmt.Sprintf(NewMustSearch, mustQueryArrStr, fmt.Sprintf(`,"_source":[%s],"sort":{%s},"from":0,"size":%d`, fields, `"publishtime":"desc","id":"desc"`, config.Config.PortraitCount))
 			list := elastic.Get(biddingIndex, biddingIndex, listQuery)
 			if list != nil && len(*list) > 0 {
 				dataArr = *list