Browse Source

Merge pull request '获取统计开始时间和结束时间代码bug处理' (#757) from fix-674 into V20211115

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/757
Reviewed-by: lewis <747342561@qq.com>
Reviewed-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1
zouap 4 years ago
parent
commit
d9f99cbc25
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