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