time.Now().Format("20060102_150405")
This commit is contained in:
parent
7118d4c9f6
commit
ccffdb1381
|
@ -60,7 +60,7 @@ func (s *StaffSalary) Agent(month string, ctx *gin.Context) {
|
|||
}
|
||||
|
||||
if xls != "" {
|
||||
filename := fmt.Sprintf("agent_%d.xlsx", time.Now().Unix())
|
||||
filename := fmt.Sprintf("agent_%s.xlsx", time.Now().Format("20060102_150405"))
|
||||
s.toExcel(filename, header, datas, ctx)
|
||||
os.Remove(filename)
|
||||
} else {
|
||||
|
@ -118,7 +118,7 @@ func (s *StaffSalary) Bank(month string, ctx *gin.Context) {
|
|||
}
|
||||
|
||||
if xls != "" {
|
||||
filename := fmt.Sprintf("bank_%d.xlsx", time.Now().Unix())
|
||||
filename := fmt.Sprintf("bank_%s.xlsx", time.Now().Format("20060102_150405"))
|
||||
s.toExcel(filename, header, datas, ctx)
|
||||
os.Remove(filename)
|
||||
} else {
|
||||
|
@ -194,7 +194,7 @@ func (s *StaffSalary) Summary(month string, ctx *gin.Context) {
|
|||
cast.ToString(summary.RealSalary - summary.SocialInsurence - summary.PersonalTax)})
|
||||
|
||||
if xls != "" {
|
||||
filename := fmt.Sprintf("summary_%d.xlsx", time.Now().Unix())
|
||||
filename := fmt.Sprintf("summary_%s.xlsx", time.Now().Format("20060102_150405"))
|
||||
s.toExcel(filename, header, datas, ctx)
|
||||
os.Remove(filename)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue