|
@@ -19,7 +19,7 @@ const (
|
|
|
must_match = `{"bool":{"must":[%s]}}`
|
|
|
should_match = `{"bool":{"should":[%s],"minimum_should_match": 1}}`
|
|
|
NewMustSearch = `{"query":{"bool":{"must":[%s]}}%s}`
|
|
|
- ListSearchLimit = `,"_source":[%s],"sort":[{"publishtime":{"order":"desc"}}],"from":%d,"size":%d`
|
|
|
+ ListSearchLimit = `,"_source":[%s],"sort":[{"%s":{"order":"desc"}}],"from":%d,"size":%d`
|
|
|
|
|
|
newBiddingSearchShowSql = `{"query":{"filtered":{"filter":{"bool":{"must":[%s,{"range":{"firsttime":{"gte":"%d"}}}]}}}},"aggs":{"group_area":{"terms":{"field":"area","size":40}},"group_scopeArr":{"terms":{"field":"subscopeclass","size":20}}}}`
|
|
|
)
|
|
@@ -219,8 +219,8 @@ func (pwp *PortraitProjectScreen) GetWinnerList() (list []map[string]interface{}
|
|
|
}
|
|
|
start, limit := (pwp.PageNum-1)*pwp.PageSize, pwp.PageSize
|
|
|
//列表查询
|
|
|
- listQuery := fmt.Sprintf(NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(ListSearchLimit, `"_id","projectname","bidamount","title","publishtime","subtype","toptype","area"`, start, limit))
|
|
|
- log.Printf("PortraitWinnerProject GetList Sql %s\n", listQuery)
|
|
|
+ listQuery := fmt.Sprintf(NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(ListSearchLimit, `"_id","projectname","bidamount","title","publishtime","subtype","toptype","area"`, "publishtime", start, limit))
|
|
|
+ //log.Printf("PortraitWinnerProject GetList Sql %s\n", listQuery)
|
|
|
newData := elastic.Get(biddingIndex, biddingType, listQuery)
|
|
|
|
|
|
if newData == nil || len(*newData) == 0 {
|
|
@@ -316,7 +316,7 @@ func (pwp *PortraitProjectScreen) GetBuyerList() (list []map[string]interface{},
|
|
|
if pwp.PageNum == 1 {
|
|
|
total = elastic.Count(projectIndex, projectIndex, fmt.Sprintf(NewMustSearch, strings.Join(mustQueryArr, ","), ""))
|
|
|
if total <= 0 {
|
|
|
- log.Println(fmt.Sprintf(NewMustSearch, strings.Join(mustQueryArr, ","), ""))
|
|
|
+ //log.Println(fmt.Sprintf(NewMustSearch, strings.Join(mustQueryArr, ","), ""))
|
|
|
return
|
|
|
}
|
|
|
} else {
|
|
@@ -325,8 +325,8 @@ func (pwp *PortraitProjectScreen) GetBuyerList() (list []map[string]interface{},
|
|
|
start, limit := (pwp.PageNum-1)*pwp.PageSize, pwp.PageSize
|
|
|
|
|
|
//列表查询
|
|
|
- listQuery := fmt.Sprintf(NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(ListSearchLimit, `"bidstatus","list.infoid","list.title","list.subtype","projectname","list.area","firsttime","area"`, start, limit))
|
|
|
- log.Printf("PortraitWinnerProject GetList Sql %s\n", listQuery)
|
|
|
+ listQuery := fmt.Sprintf(NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(ListSearchLimit, `"bidstatus","list.infoid","list.title","list.subtype","projectname","list.area","firsttime","area"`, "firsttime", start, limit))
|
|
|
+ //log.Printf("PortraitWinnerProject GetList Sql %s\n", listQuery)
|
|
|
newData := elastic.Get(projectIndex, projectType, listQuery)
|
|
|
|
|
|
if newData == nil || len(*newData) == 0 {
|