|
@@ -383,7 +383,6 @@ func getNzjList(infoMap map[string]interface{}) (count int64, list *[]map[string
|
|
|
if isEmpty(infoMap) {
|
|
|
return nzjEmptySearch(pageNum, pageSize)
|
|
|
}
|
|
|
-
|
|
|
categoryCodeArr := public.GlobalCommonMysql.SelectBySql(fmt.Sprintf(`SELECT category_code FROM Jianyu_subjectdb.dwd_f_nzj_category_rule WHERE stage_info = '%s'`, common.InterfaceToStr(infoMap["keyWord"])))
|
|
|
if categoryCodeArr != nil && len(*categoryCodeArr) > 0 {
|
|
|
var codes []string
|
|
@@ -393,18 +392,10 @@ func getNzjList(infoMap map[string]interface{}) (count int64, list *[]map[string
|
|
|
infoMap["keyCode"] = codes
|
|
|
}
|
|
|
musts := esQuery(infoMap)
|
|
|
- if pageNum == 1 {
|
|
|
- count = elastic.Count(proposed, proposed, fmt.Sprintf(`{"query": {"bool": {"must": [%s]}}}`, strings.Join(musts, ",")))
|
|
|
- if count == 0 {
|
|
|
- return count, nil
|
|
|
- }
|
|
|
- if count > common.Int64All(config.Sysconfig["nzjLimit"]) {
|
|
|
- count = common.Int64All(config.Sysconfig["nzjLimit"])
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- list = elastic.Get(proposed, proposed, fmt.Sprintf(`{"query": {"bool": {"must": [%s]}},"_source":["projectname","area","area_city","lasttime","project_stage","ownerclass","proposed_id","category","project_stage"],"sort":[{"lasttime":{"order":"desc"}}],"from":%d,"size":%d}`, strings.Join(musts, ","), (pageNum-1)*pageSize, pageSize))
|
|
|
- if list != nil && len(*list) > 0 {
|
|
|
+ var listArr []map[string]interface{}
|
|
|
+ _, count, listArr = elastic.GetAggs(proposed, proposed, fmt.Sprintf(`{"track_total_hits": true,"query": {"bool": {"must": [%s]}},"_source":["projectname","area","area_city","lasttime","project_stage","ownerclass","proposed_id","category","project_stage"],"sort":[{"lasttime":{"order":"desc"}}],"from":%d,"size":%d}`, strings.Join(musts, ","), (pageNum-1)*pageSize, pageSize))
|
|
|
+ if listArr != nil && len(listArr) > 0 {
|
|
|
+ list = &listArr
|
|
|
for _, v := range *list {
|
|
|
v["proposed_id"] = encrypt.SE2.Encode2Hex(common.InterfaceToStr(v["proposed_id"]))
|
|
|
//v["lasttime"] = MillisecondsToStr(common.Int64All(v["lasttime"]))
|
|
@@ -413,6 +404,10 @@ func getNzjList(infoMap map[string]interface{}) (count int64, list *[]map[string
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if count > common.Int64All(config.Sysconfig["nzjLimit"]) {
|
|
|
+ count = common.Int64All(config.Sysconfig["nzjLimit"])
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
|