| @@ -173,7 +173,7 @@ func GetAllCloudbrainsTrend(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| } else if queryType == "last_7day" { | } 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()) | beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) | ||||
| endTime = now | endTime = now | ||||
| endTimeTemp = beginTime.AddDate(0, 0, 1) | endTimeTemp = beginTime.AddDate(0, 0, 1) | ||||
| @@ -185,7 +185,7 @@ func GetAllCloudbrainsTrend(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| } else if queryType == "last_30day" { | } 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()) | beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) | ||||
| endTime = now | endTime = now | ||||
| endTimeTemp = beginTime.AddDate(0, 0, 1) | 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")) | ctx.Error(http.StatusBadRequest, ctx.Tr("repo.parameter_is_wrong")) | ||||
| return | return | ||||
| } | } | ||||
| log.Info("beginTime:", beginTime) | |||||
| log.Info("beginTimecdffd:", beginTime) | |||||
| log.Info("endTime:", endTime) | log.Info("endTime:", endTime) | ||||
| // beginTime = beginTime.AddDate(0, 0, -1) | // beginTime = beginTime.AddDate(0, 0, -1) | ||||
| // endTime = endTime.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) | beginTime = endTime.AddDate(0, 0, -1) | ||||
| } else if queryType == "last_7day" { | } 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()) | beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) | ||||
| endTime = now | endTime = now | ||||
| } else if queryType == "last_30day" { | } 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()) | beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) | ||||
| endTime = now | endTime = now | ||||
| } else if queryType == "current_month" { | } else if queryType == "current_month" { | ||||