From 270727436961128972d232e8c2e66769dde8d0d9 Mon Sep 17 00:00:00 2001 From: liuzx Date: Mon, 13 Jun 2022 14:21:41 +0800 Subject: [PATCH] fix-bug --- routers/api/v1/repo/cloudbrain_dashboard.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/routers/api/v1/repo/cloudbrain_dashboard.go b/routers/api/v1/repo/cloudbrain_dashboard.go index 8b9ba4b99..23b9f3080 100644 --- a/routers/api/v1/repo/cloudbrain_dashboard.go +++ b/routers/api/v1/repo/cloudbrain_dashboard.go @@ -173,7 +173,7 @@ func GetAllCloudbrainsTrend(ctx *context.Context) { return } } else if queryType == "last_7day" { - beginTime = now.AddDate(0, 0, -6) //begin from monday + beginTime = now.AddDate(0, 0, -6) beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) endTime = now endTimeTemp = beginTime.AddDate(0, 0, 1) @@ -185,7 +185,7 @@ func GetAllCloudbrainsTrend(ctx *context.Context) { return } } else if queryType == "last_30day" { - beginTime = now.AddDate(0, 0, -29) //begin from monday + beginTime = now.AddDate(0, 0, -29) beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) endTime = now endTimeTemp = beginTime.AddDate(0, 0, 1) @@ -473,7 +473,7 @@ func GetAllCloudbrainsPeriodDistribution(ctx *context.Context) { ctx.Error(http.StatusBadRequest, ctx.Tr("repo.parameter_is_wrong")) return } - log.Info("beginTime:", beginTime) + log.Info("beginTimecdffd:", beginTime) log.Info("endTime:", endTime) // beginTime = beginTime.AddDate(0, 0, -1) // endTime = endTime.AddDate(0, 0, -1) @@ -1250,11 +1250,11 @@ func getCloudbrainTimePeroid(ctx *context.Context, recordBeginTime time.Time) (t beginTime = endTime.AddDate(0, 0, -1) } else if queryType == "last_7day" { - beginTime = now.AddDate(0, 0, -7) + beginTime = now.AddDate(0, 0, -6) beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) endTime = now } else if queryType == "last_30day" { - beginTime = now.AddDate(0, 0, -30) + beginTime = now.AddDate(0, 0, -29) beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) endTime = now } else if queryType == "current_month" {