From aa2b4de7f88f55242b85a8350b46ef7e7859cecc Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 17 May 2022 15:43:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/user_data_analysis.go | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index 4a3ff5f38..4def050dc 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -290,7 +290,7 @@ func queryMetrics(ctx *context.Context, tableName string, startTime time.Time, e xlsx.SetActiveSheet(index) filename := sheetName + "_" + ctx.Tr("user.static."+tableName) + ".xlsx" if tableName == "" { - filename = sheetName + "_" + startTime.Format("20060102") + "_" + endTime.Format("20060102") + filename = sheetName + "_" + startTime.Format("20060102") + "_" + endTime.Format("20060102") + ".xlsx" } ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+url.QueryEscape(filename)) ctx.Resp.Header().Set("Content-Type", "application/octet-stream") @@ -418,23 +418,10 @@ func QueryUserMetricDataPage(ctx *context.Context) { startDate := ctx.Query("startDate") endDate := ctx.Query("endDate") startTime, _ := time.ParseInLocation("2006-01-02", startDate, time.Local) + startTime = startTime.UTC() endTime, _ := time.ParseInLocation("2006-01-02", endDate, time.Local) - - page := ctx.QueryInt("page") - if page <= 0 { - page = 1 - } - pageSize := ctx.QueryInt("pageSize") - if pageSize <= 0 { - pageSize = setting.UI.IssuePagingNum - } + startTime = getStartTime(startTime) queryMetrics(ctx, "", startTime, endTime) - // result, count := models.QueryMetricsPage(startTime.Unix(), endTime.Unix(), page, pageSize) - - // mapInterface := make(map[string]interface{}) - // mapInterface["data"] = result - // mapInterface["count"] = count - // ctx.JSON(http.StatusOK, mapInterface) } func QueryUserStaticDataPage(ctx *context.Context) {