Skip to content

Commit

Permalink
修复了一些 Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Away0x committed Aug 18, 2019
1 parent 24d24d7 commit 8344ecc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
12 changes: 6 additions & 6 deletions database/factory/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import (
var (
// 头像假数据
avatars = []string{
"https://iocaffcdn.phphub.org/uploads/images/201710/14/1/s5ehp11z6s.png",
"https://iocaffcdn.phphub.org/uploads/images/201710/14/1/Lhd1SHqu86.png",
"https://iocaffcdn.phphub.org/uploads/images/201710/14/1/LOnMrqbHJn.png",
"https://iocaffcdn.phphub.org/uploads/images/201710/14/1/xAuDMxteQy.png",
"https://iocaffcdn.phphub.org/uploads/images/201710/14/1/ZqM7iaP4CR.png",
"https://iocaffcdn.phphub.org/uploads/images/201710/14/1/NDnzMutoxX.png",
"https://cdn.learnku.com/uploads/avatars/7850_1481780622.jpeg!/both/380x380",
"https://cdn.learnku.com/uploads/avatars/7850_1481780622.jpeg!/both/380x380",
"https://cdn.learnku.com/uploads/avatars/7850_1481780622.jpeg!/both/380x380",
"https://cdn.learnku.com/uploads/avatars/7850_1481780622.jpeg!/both/380x380",
"https://cdn.learnku.com/uploads/avatars/7850_1481780622.jpeg!/both/380x380",
"https://cdn.learnku.com/uploads/avatars/7850_1481780622.jpeg!/both/380x380",
}
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
9 changes: 6 additions & 3 deletions pkg/ginutils/time/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ func SinceForHuman(t time.Time) string {
unit := "秒"
s := 0
if hour > (365 * 24) {
s = int(math.Floor(hour / 365))
s = int(math.Floor(hour / (365 * 24)))
unit = "年"
} else if hour > 30 {
s = int(math.Floor(hour / 30))
} else if hour > (30 * 24) {
s = int(math.Floor(hour / (30 * 24)))
unit = "月"
} else if hour > 24 {
s = int(math.Floor(hour / 24))
unit = "天"
} else if hour > 1 {
s = int(math.Floor(hour))
unit = "小时"
Expand Down

0 comments on commit 8344ecc

Please sign in to comment.