Browse Source

fix-bug

tags/v1.22.6.1^2
liuzx 3 years ago
parent
commit
2707274369
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      routers/api/v1/repo/cloudbrain_dashboard.go

+ 5
- 5
routers/api/v1/repo/cloudbrain_dashboard.go View File

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


Loading…
Cancel
Save