From 0ec920e08e00d24c2810b3e8f71df585f4291367 Mon Sep 17 00:00:00 2001 From: dorlolo <428192774@qq.com> Date: Fri, 24 Mar 2023 09:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=80=E8=AF=B7=E7=A0=81?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E6=9F=A5=E8=AF=A2=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/dao/artistInfo_user.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/internal/dao/artistInfo_user.go b/cmd/internal/dao/artistInfo_user.go index 1847518..df60c22 100644 --- a/cmd/internal/dao/artistInfo_user.go +++ b/cmd/internal/dao/artistInfo_user.go @@ -1029,7 +1029,7 @@ func GetInvitedUserList(in *artistInfoUser.GetInvitedUserListRequest) (res *arti return } -// 通过受邀请人的邀请码,查询他的邀请人列表 +// 通过受邀请人的邀请码,查询他的邀请人列表 (被哪些人邀请过) func GetInviterUserList(in *artistInfoUser.GetInviterUserListRequest) (res *artistInfoUser.GetInvitedUserListResponse, err error) { res = &artistInfoUser.GetInvitedUserListResponse{ Data: []*artistInfoUser.InvitedUser{}, @@ -1039,7 +1039,7 @@ func GetInviterUserList(in *artistInfoUser.GetInviterUserListRequest) (res *arti }, } var inviteCodes []string - db.DB.Model(model.Invite{}).Where("invited_code = ?", in.InvitedCode).Pluck("invite_code", &inviteCodes) + db.DB.Model(model.UserInvited{}).Where("invited_code = ?", in.InvitedCode).Pluck("invite_code", &inviteCodes) var invitedList []model.User orm := db.DB.Model(model.User{}).Preload("RealNameInfo").Where("invited_code in ?", inviteCodes) //查询邀请人 if err = orm.Count(&res.Page.Total).Scopes(db.Pagination(in.Page, in.PageSize)).Find(&invitedList).Error; err != nil { @@ -1128,7 +1128,7 @@ func GetInviteStaticList(in *artistInfoUser.GetInviteStaticListRequest) (res *ar Where("su.deleted_at=0"). Group("ui.invite_code") //HAVING count(ui.invited_code) >0 if in.Keyword != "" { - orm = orm.Where(fmt.Sprintf("rn.name LIKE '%%%v%%' OR su.tel_num LIKE '%%%v%%' OR su.invited_code LIKE '%%%v%%' ", in.Keyword, in.Keyword, in.Keyword)) + orm = orm.Where(fmt.Sprintf("rn.name LIKE '%%%v%%' OR su.tel_num LIKE '%%%v%%' OR su.invited_code LIKE '%%%v%%'", in.Keyword, in.Keyword, in.Keyword)) } var datas []inviteStatic err = orm.Count(&res.Page.Total).Scopes(db.Pagination(in.Page, in.PageSize)).Find(&datas).Error