wangshan 7 maanden geleden
bovenliggende
commit
7cc6832e89
2 gewijzigde bestanden met toevoegingen van 3 en 7 verwijderingen
  1. 1 1
      jyBXSubscribe/rpc/internal/logic/getsublistlogic.go
  2. 2 6
      jyBXSubscribe/rpc/model/push.go

+ 1 - 1
jyBXSubscribe/rpc/internal/logic/getsublistlogic.go

@@ -161,7 +161,7 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 		Data: &bxsubscribe.SubscribeData{
 			List:        list,
 			Count:       total,
-			HasNextPage: hasNextPage,
+			HasNextPage: hasNextPage, //前端没用到这个字段
 			IsRecommend: isRecommend,
 			SubListTip:  tip,
 		},

+ 2 - 6
jyBXSubscribe/rpc/model/push.go

@@ -515,13 +515,9 @@ func (s *subscribePush) inactiveQuery(spqp *SubPushQueryParam, bsp *ViewConditio
 			starttime = time.Now().AddDate(0, 0, -15).Unix()
 			endtime = time.Now().Unix()
 		}
-		qstr := s.getFreeDatasSQL(bsp, starttime, endtime, (spqp.PageNum-1)*spqp.PageSize)
-		log.Println("inactiveQuery---:", qstr)
+		qstr := s.getFreeDatasSQL(bsp, starttime, endtime, (spqp.PageNum-1)*spqp.PageSize, spqp.PageSize)
 		//list = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSort, bidField, 0, 4500, 0, false)
 		count, list = elastic.GetWithCount(INDEX, TYPE, "", qstr)
-		if len(*list) > spqp.PageSize {
-			*list = (*list)[:spqp.PageSize]
-		}
 	}
 	if count > 500 {
 		count = 500
@@ -1490,7 +1486,7 @@ func getKeys(title string, keywords []ViewKeyWord) (str []string) {
 }
 
 // 获取查询语句
-func (s *subscribePush) getFreeDatasSQL(bsp *ViewCondition, startTime, endTime int64, startNumb int) (str string) {
+func (s *subscribePush) getFreeDatasSQL(bsp *ViewCondition, startTime, endTime int64, startNumb, size int) (str string) {
 	query := `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match": %d}},"_source":[%s],"sort": [{"publishtime": "desc"}],"from":%d,"size":%d}`
 	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
 	multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`