Browse Source

fix: GetMaxUserId use Unscope, close #987

creamlike1024 10 months ago
parent
commit
c2b33e3b23
1 changed files with 1 additions and 1 deletions
  1. 1 1
      model/user.go

+ 1 - 1
model/user.go

@@ -108,7 +108,7 @@ func CheckUserExistOrDeleted(username string, email string) (bool, error) {
 
 func GetMaxUserId() int {
 	var user User
-	DB.Last(&user)
+	DB.Unscoped().Last(&user)
 	return user.Id
 }