Fix: uint may overflow / Test: get user storage

This commit is contained in:
HFO4 committed 2019-12-07 15:05:48 +08:00
1 parent 9386371097
commit f4c414c0f6
11 files changed
+126 -61

No files matched your search

+1 -1
View File
@@ -65,7 +65,7 @@ func (user *User) DeductionStorage(size uint64) bool {
DB.Model(user).UpdateColumn("storage", gorm.Expr("storage - ?", size))
return true
}
// 如果要减少的容量超出以用容量,则设为零
// 如果要减少的容量超出已用容量,则设为零
user.Storage = 0
DB.Model(user).UpdateColumn("storage", 0)