mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-17 22:58:07 +00:00
Fix: uint may overflow / Test: get user storage
This commit is contained in:
1 parent
9386371097
commit
f4c414c0f6
11 files changed
+126
-61
No files matched your search
+1
-1
@@ -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