Commit 14ee16af authored by hujiebin's avatar hujiebin

99+

parent 71871c7f
......@@ -11,7 +11,7 @@ type CvCp struct {
User2 *user_cv.CvUserBase `json:"user2"` // user2
Score uint32 `json:"score"` // 分值
CpLevel CvCpLevel `json:"cpLevel"` // cp等级
//Ranking int `json:"ranking"` // 排名
Ranking string `json:"ranking"` // 排名
}
type CvCpAchievement struct {
......
package cp_r
import (
"fmt"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/resource/mysql"
......@@ -70,13 +71,13 @@ func CpRank(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, err
}
cpLevels := cp_m.MGetCpLevel(model, cpIds)
for _, rank := range ranks {
for i, rank := range ranks {
response = append(response, cp_cv.CvCp{
CpId: rank.CpId,
User1: userBase[rank.UserId1],
User2: userBase[rank.UserId2],
Score: rank.Score,
//Ranking: i + 1 + offset,
CpId: rank.CpId,
User1: userBase[rank.UserId1],
User2: userBase[rank.UserId2],
Score: rank.Score,
Ranking: fmt.Sprintf("%d", i+1+offset),
CpLevel: cp_cv.CvCpLevel{
Level: cpLevels[rank.CpId].Level,
//Points: cp_e.CpLevelPoints[cpLevel] + curPoints,
......@@ -149,6 +150,7 @@ func CpMy(c *gin.Context) (*mycontext.MyContext, error) {
}
if relation.UserId2 > 0 {
response.User2 = userBases[relation.UserId2]
response.Ranking = "99+"
}
resp.ResponseOk(c, response)
return myCtx, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment