diff --git a/model/user.go b/model/user.go index c15e5370..0aea2ff5 100644 --- a/model/user.go +++ b/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 }