update: 月份查询改为时间倒序

This commit is contained in:
BaoXuebin 2022-09-03 23:21:25 +08:00
parent 735e322942
commit cb72b18513
1 changed files with 4 additions and 1 deletions

View File

@ -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