Browse Source

Merge branch 'V20211115' into fix-683

tags/v1.21.12.1
zhoupzh 4 years ago
parent
commit
f836f5c7a7
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      routers/api/v1/repo/repo_dashbord.go

+ 4
- 4
routers/api/v1/repo/repo_dashbord.go View File

@@ -198,7 +198,7 @@ func getFileName(ctx *context.Context, beginTime time.Time, endTime time.Time) s
if ctx.QueryTrim("q") != "" { if ctx.QueryTrim("q") != "" {
baseName = baseName + ctx.QueryTrim("q") + "_" baseName = baseName + ctx.QueryTrim("q") + "_"
} }
baseName = baseName + beginTime.Format(DATE_FORMAT) + "_to_" + endTime.Format(DATE_FORMAT) + "_" + strconv.FormatInt(time.Now().Unix(), 10) + ".csv"
baseName = baseName + beginTime.AddDate(0, 0, -1).Format(DATE_FORMAT) + "_to_" + endTime.AddDate(0, 0, -1).Format(DATE_FORMAT) + "_" + strconv.FormatInt(time.Now().Unix(), 10) + ".csv"
return baseName return baseName
} }


@@ -424,7 +424,7 @@ func getTimePeroid(ctx *context.Context, recordBeginTime time.Time) (time.Time,
endTimeStr := ctx.QueryTrim("endTime") endTimeStr := ctx.QueryTrim("endTime")
var beginTime time.Time var beginTime time.Time
var endTime time.Time var endTime time.Time
var err error
if queryType != "" { if queryType != "" {


if queryType == "all" { if queryType == "all" {
@@ -469,12 +469,12 @@ func getTimePeroid(ctx *context.Context, recordBeginTime time.Time) (time.Time,


} else { } else {


beginTime, err := time.Parse("2006-01-02", beginTimeStr)
beginTime, err = time.Parse("2006-01-02", beginTimeStr)
if err != nil { if err != nil {
return now, now, err return now, now, err
} }


endTime, err := time.Parse("2006-01-02", endTimeStr)
endTime, err = time.Parse("2006-01-02", endTimeStr)
if err != nil { if err != nil {
return now, now, err return now, now, err
} }


Loading…
Cancel
Save