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