Update token.go

This commit is contained in:
luxl
2023-11-14 16:41:19 +08:00
committed by GitHub
parent d0ab44d6cb
commit b2dd63f9a0

View File

@@ -33,7 +33,7 @@ func SearchUserTokens(userId int, keyword string, token string) (tokens []*Token
if token != "" {
token = strings.Trim(token, "sk-")
}
err = DB.Where("user_id = ?", userId).Where("name LIKE ?", keyword+"%").Where("key LIKE ?", token+"%").Find(&tokens).Error
err = DB.Where("user_id = ?", userId).Where("name LIKE ?", keyword+"%").Where("`key` LIKE ?", token+"%").Find(&tokens).Error
return tokens, err
}