mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: uint may overflow / Test: get user storage
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user