Explorar o código

fix: GetMaxUserId use Unscope, close #987

creamlike1024 hai 10 meses
pai
achega
c2b33e3b23
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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
 }