fix: 修正 FetchCountryLeaderboard 函数中 offset 参数的计算逻辑,确保正确分页请求玩家数据
This commit is contained in:
parent
64e0db9f96
commit
0bb502faba
@ -72,7 +72,7 @@ func FetchCountryLeaderboard(country string, offset int, userId string) ([]Playe
|
|||||||
if offset < 1 {
|
if offset < 1 {
|
||||||
offset = 1
|
offset = 1
|
||||||
}
|
}
|
||||||
url := fmt.Sprintf("https://api.beatleader.com/players?leaderboardContext=general&page=%d&count=50&sortBy=pp&mapsType=ranked&ppType=general&order=desc&countries=%s", offset/50+1, country)
|
url := fmt.Sprintf("https://api.beatleader.com/players?leaderboardContext=general&page=%d&count=50&sortBy=pp&mapsType=ranked&ppType=general&order=desc&countries=%s", (offset-1)/50+1, country)
|
||||||
|
|
||||||
// 创建请求
|
// 创建请求
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user