From c81515d1d20c0376f9154d4e7a34b20954f3915c Mon Sep 17 00:00:00 2001 From: dorlolo <428192774@qq.com> Date: Thu, 23 Mar 2023 19:19:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/dao/artistInfo_user.go | 4 ++-- go.mod | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/internal/dao/artistInfo_user.go b/cmd/internal/dao/artistInfo_user.go index b1e066d..0ce9bc0 100644 --- a/cmd/internal/dao/artistInfo_user.go +++ b/cmd/internal/dao/artistInfo_user.go @@ -661,7 +661,7 @@ func GetViewUserList(req *artistInfoUser.FindUsersRequest) (resp []model.UserVie tx = tx.Where("mgmt_artist_uid in ?", req.MgmtArtistUids) } if req.InviterName != "" { - tx = tx.Where("inviter_real_name LIKE '%?%'", req.InviterName) + tx = tx.Where("inviter_real_name LIKE ?", "%"+req.InviterName+"%") } if req.IsArtist { tx = tx.Where("mgmt_artist_uid !='' ") @@ -1124,7 +1124,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.KeyWords != "" { - orm = orm.Where("rn.name LIKE '%%?%%' OR su.tel_num LIKE '%%?%%' OR su.invited_code LIKE '%%?%%' ", in.KeyWords, in.KeyWords, in.KeyWords) + orm = orm.Where(fmt.Sprintf("rn.name LIKE '%%%v%%' OR su.tel_num LIKE '%%%v%%' OR su.invited_code LIKE '%%%v%%' ", in.KeyWords, in.KeyWords, in.KeyWords)) } var datas []inviteStatic err = orm.Count(&res.Page.Total).Scopes(db.Pagination(in.Page, in.PageSize)).Find(&datas).Error diff --git a/go.mod b/go.mod index 81b88ce..3905a63 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/fonchain/fonchain-artistinfo -go 1.19 +go 1.18 replace ( //github.com/fonchain/electronic-contract => ../electronic-contract