diff --git a/service/beatleader/bind_bl.go b/service/beatleader/bind_bl.go index 4f0680a..6b0a0dd 100644 --- a/service/beatleader/bind_bl.go +++ b/service/beatleader/bind_bl.go @@ -319,7 +319,10 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er // } // return records, nil - + playerData, err := FetchPlayerData(blId) + if err != nil { + return nil, err + } //从线上获取 historyUrl := "https://api.beatleader.xyz/player/%s/scores?count=%d" fullUrl := fmt.Sprintf(historyUrl, blId, count) @@ -344,9 +347,9 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er for _, score := range scores { dataLite := RecordDataLite{ ScoreID: score.ID, - BlID: score.Player.ID, - Name: score.Player.Name, - Country: score.Player.Country, + BlID: blId, + Name: playerData.Name, + Country: playerData.Country, SongName: score.Leaderboard.Song.Name, SongSubName: score.Leaderboard.Song.SubName, SongAuthorName: score.Leaderboard.Song.Author, @@ -367,7 +370,7 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er DeviceHmd: GetHMDStr(score.HMD), DeviceControllerLeft: GetControllerStr(score.Controller), DeviceControllerRight: GetControllerStr(score.Controller), - GeneratedTime: time.Now().Format("2006-01-02 15:04:05.999999999-07:00"), + GeneratedTime: time.Unix(score.Timepost, 0).Format("2006-01-02 15:04:05.999999999-07:00"), } if score.Leaderboard.Difficulty.Stars != nil { dataLite.Stars = *score.Leaderboard.Difficulty.Stars