| @@ -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 | ||||
| } | } | ||||