Selaa lähdekoodia

fix: GetMaxUserId use Unscope, close #987

creamlike1024 10 kuukautta sitten
vanhempi
commit
c2b33e3b23
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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
 }