diff --git a/route/user_r/inner.go b/route/user_r/inner.go index 1cd7127df76b9df9de578941f5fdd01a177bb6ea..ad8e7e45920786ac1e22f184e67c304ceeda7b3e 100644 --- a/route/user_r/inner.go +++ b/route/user_r/inner.go @@ -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)