diff --git a/route/cp_r/rank.go b/route/cp_r/rank.go index a0cd46f272568e749b24299d7118d5bf4778a891..cbcbb6990a924a7c886b0ae1740a522ecba0cba5 100644 --- a/route/cp_r/rank.go +++ b/route/cp_r/rank.go @@ -222,6 +222,13 @@ func CpMy(c *gin.Context) (*mycontext.MyContext, error) { if relation.UserId2 > 0 { response.User2 = userBases[relation.UserId2] response.Ranking = "99+" + ranks := cp_m.PageCpDayRank(model, beginDate, endDate, 0, 30) + for i, rank := range ranks { + if relation.ID == rank.CpId { + response.Ranking = fmt.Sprintf("%d", i+1) + break + } + } } resp.ResponseOk(c, response) return myCtx, nil