Commit db812065 authored by hujiebin's avatar hujiebin

把level也返回

parent 3684327b
......@@ -242,10 +242,15 @@ func GetUserCpPair(c *gin.Context) (*mycontext.MyContext, error) {
m[uid] = true
}
pairs := cp_m.MGetCpRelation(model, userIds)
var response [][2]uint64
var cpIds []mysql.ID
for _, pair := range pairs {
cpIds = append(cpIds, pair.Id)
}
levels := cp_m.MGetCpLevel(model, cpIds)
var response [][3]uint64
for _, pair := range pairs {
if m[pair.UserId1] && m[pair.UserId2] {
response = append(response, [2]mysql.ID{pair.UserId1, pair.UserId2})
response = append(response, [3]mysql.ID{pair.UserId1, pair.UserId2, uint64(levels[pair.Id].Level)})
}
}
resp.ResponseOk(c, response)
......
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