Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/2115/head
zouap 3 years ago
parent
commit
aa2b4de7f8
1 changed files with 3 additions and 16 deletions
  1. +3
    -16
      routers/repo/user_data_analysis.go

+ 3
- 16
routers/repo/user_data_analysis.go View File

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


Loading…
Cancel
Save