瀏覽代碼

Merge branch 'dev/v1.1.51_dx' of BaseService/jyMicroservices into feature/v1.1.51

duxin 1 年之前
父節點
當前提交
f3b77b5945
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      jyBXCore/rpc/entity/search.go

+ 5 - 1
jyBXCore/rpc/entity/search.go

@@ -97,7 +97,11 @@ func (kws *KeyWordsSearch) GetBidSearchListByCache(in *bxcore.SearchReq) (list [
 		if count > limitCount {
 			count = limitCount
 		}
-		list = l[(in.PageNum-1)*in.PageSize : in.PageNum*in.PageSize]
+		if len(l) >= int(in.PageNum*in.PageSize) {
+			list = l[(in.PageNum-1)*in.PageSize : in.PageNum*in.PageSize]
+		} else {
+			list = l[(in.PageNum-1)*in.PageSize:]
+		}
 		//是否收藏
 		util.MakeCollection(in.UserId, list)
 	}