From f2f7bcf3cd831c76a91aaed456b11bec1fede3cd Mon Sep 17 00:00:00 2001 From: "teamgram.io" Date: Sun, 11 Sep 2022 15:02:23 +0800 Subject: [PATCH] feat: performance optimization - user --- .../biz/user/internal/core/user.getMutableUsers_handler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/service/biz/user/internal/core/user.getMutableUsers_handler.go b/app/service/biz/user/internal/core/user.getMutableUsers_handler.go index 05adc9979..bb68e5900 100644 --- a/app/service/biz/user/internal/core/user.getMutableUsers_handler.go +++ b/app/service/biz/user/internal/core/user.getMutableUsers_handler.go @@ -58,7 +58,11 @@ func (c *UserCore) UserGetMutableUsers(in *user.TLUserGetMutableUsers) (*user.Ve if ok, _ := container2.Contains(id[idx], in.To); ok { mutableUsers[idx], _ = c.svcCtx.Dao.GetImmutableUser(c.ctx, id[idx], true, in.Id...) } else { - mutableUsers[idx], _ = c.svcCtx.Dao.GetImmutableUser(c.ctx, id[idx], true, in.Id...) + if len(in.To) == 0 { + mutableUsers[idx], _ = c.svcCtx.Dao.GetImmutableUser(c.ctx, id[idx], true, in.Id...) + } else { + mutableUsers[idx], _ = c.svcCtx.Dao.GetImmutableUser(c.ctx, id[idx], true, in.To...) + } } })