From cb72b18513ffc4c0fb9ec5a10e209875c4bfbfbd Mon Sep 17 00:00:00 2001 From: BaoXuebin Date: Sat, 3 Sep 2022 23:21:25 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9C=88=E4=BB=BD=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=97=B6=E9=97=B4=E5=80=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/stats.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/stats.go b/service/stats.go index 2478f99..b7fc97a 100644 --- a/service/stats.go +++ b/service/stats.go @@ -19,8 +19,11 @@ type YearMonth struct { func MonthsList(c *gin.Context) { ledgerConfig := script.GetLedgerConfigFromContext(c) + // 添加排序 + queryParams := script.GetQueryParams(c) + queryParams.OrderBy = "year, month desc" yearMonthList := make([]YearMonth, 0) - err := script.BQLQueryList(ledgerConfig, nil, &yearMonthList) + err := script.BQLQueryList(ledgerConfig, &queryParams, &yearMonthList) if err != nil { InternalError(c, err.Error()) return