From db81206587ff762aca7d6f1f60eb0f89aee6c728 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Thu, 15 Jun 2023 15:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8Alevel=E4=B9=9F=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/user_r/inner.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/route/user_r/inner.go b/route/user_r/inner.go index 1cd7127..ad8e7e4 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) -- 2.22.0