WH01243 před 2 roky
rodič
revize
4ea55e78fc
1 změnil soubory, kde provedl 9 přidání a 4 odebrání
  1. 9 4
      jyBXSubscribe/rpc/model/push.go

+ 9 - 4
jyBXSubscribe/rpc/model/push.go

@@ -280,16 +280,21 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 	} else if spqp.IsEmpty() && (spqp.PageNum-1)*spqp.PageSize < 200 && len(spqp.SelectInfoIds) == 0 && !spqp.Export { //全部,没有过滤条件 之前缓存5页*50条=250 非数据导出
 		allCache := &SubPush{}
 		var err error
-		if spqp.IsEnt == false {
+		if !spqp.IsEnt {
 			allCache, err = s.GetAllCache(spqp.UserId)
 		}
 		if err != nil {
 			logx.Info(spqp.UserId, "GetAllCache Error", err)
 		}
 		if err != nil || allCache == nil || allCache.Date != nowFormat || len(allCache.Datas) == 0 {
-			spqp.PageNum = 1
-			logx.Info(1111)
-			list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, AllSubPushCacheSize, true)
+			list, countSearch := []*bxsubscribe.SubscribeInfo{}, int64(0)
+			if spqp.IsEnt {
+				list, countSearch = s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, true)
+			} else {
+				spqp.PageNum = 1
+				list, countSearch = s.getDatasFromMysql(spqp, starttime, endtime, AllSubPushCacheSize, true)
+
+			}
 			allCache = &SubPush{
 				Date:  nowFormat,
 				Datas: list,