Skip to content

Commit

Permalink
分页排序
Browse files Browse the repository at this point in the history
  • Loading branch information
hulutech-web committed Nov 7, 2024
1 parent 89777b1 commit 40f855d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paginator.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ func (h *HttpResult) SearchByParams(params map[string]string, conditionMap map[s
}
}
}
//默认按照时间降序排序
q.Order("id desc")

return q
}(query)
Expand All @@ -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
Expand Down

0 comments on commit 40f855d

Please sign in to comment.