From 40f855d58ca6912c6d2f59097f555d78f45dea1e Mon Sep 17 00:00:00 2001 From: hulutech-web Date: Thu, 7 Nov 2024 12:06:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- paginator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paginator.go b/paginator.go index 7dfa359..b15b81f 100644 --- a/paginator.go +++ b/paginator.go @@ -86,8 +86,6 @@ func (h *HttpResult) SearchByParams(params map[string]string, conditionMap map[s } } } - //默认按照时间降序排序 - q.Order("id desc") return q }(query) @@ -104,6 +102,8 @@ func (r *HttpResult) ResultPagination(dest any, withes ...string) (http.Response for _, with := range withes { r.Query = r.Query.With(with) } + //默认按照时间降序排序 + r.Query.OrderBy("id", "desc") r.Query.Paginate(currentPageInt, pageSizeInt, dest, &total) URL_PATH := r.Context.Request().Origin().URL.Path