Преглед на файлове

fix: GetMaxUserId use Unscope, close #987

creamlike1024 преди 1 година
родител
ревизия
fea6f17e80
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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
 }