Commit 7e5b8f5a9bd7a4c1851499aa97b2c478b40b586f
1 parent
246103ba
Exists in
master
提交
Showing
1 changed file
with
8 additions
and
2 deletions
Show diff stats
src/mysql/dbmysql.go
| ... | ... | @@ -8,6 +8,7 @@ import ( |
| 8 | 8 | _ "github.com/go-sql-driver/mysql" |
| 9 | 9 | "os" |
| 10 | 10 | "strconv" |
| 11 | + "time" | |
| 11 | 12 | ) |
| 12 | 13 | |
| 13 | 14 | var ( |
| ... | ... | @@ -136,8 +137,13 @@ func QueryAllData() error{ |
| 136 | 137 | } |
| 137 | 138 | |
| 138 | 139 | //w := bufio.NewWriter(f) |
| 139 | - | |
| 140 | - str := strconv.Itoa(Uid) + " " + strconv.Itoa(Ulv) + " " + strconv.Itoa(Exp) + " " + strconv.Itoa(LoginTime) + "\n" | |
| 140 | + if LoginTime <= 1588262400 { | |
| 141 | + //5.1之前的不做处理 | |
| 142 | + continue | |
| 143 | + } | |
| 144 | + tm := time.Unix(int64(LoginTime), 0) | |
| 145 | + //fmt.Println(tm.Format("2006-01-02 15:04:05")) | |
| 146 | + str := strconv.Itoa(Uid) + " " + strconv.Itoa(Ulv) + " " + strconv.Itoa(Exp) + " " + tm.Format("2006-01-02 15:04:05") + "\n" | |
| 141 | 147 | _,err = f.WriteString(str) |
| 142 | 148 | logger.Info("ddt str=%v",str) |
| 143 | 149 | if err != nil { | ... | ... |