From 214b8698ad49b5fa2707fd1eb2507406ce48498e Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Fri, 25 Aug 2023 14:22:25 +0800 Subject: [PATCH] update --- app/admin/svc/svc_user.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/admin/svc/svc_user.go b/app/admin/svc/svc_user.go index 30185a3..c70658f 100644 --- a/app/admin/svc/svc_user.go +++ b/app/admin/svc/svc_user.go @@ -11,20 +11,19 @@ func UserList(req md.UserListReq) (resp md.UserListResp, err error) { var m []model.User userDb := db.UserDb{} userDb.Set() - sess := userDb.Db.Join("LEFT", "user_identity", "user.id = user_identity.uid"). - Join("LEFT", "enterprise", "user_identity.enterprise_id = enterprise.id").Limit(req.Limit, (req.Page-1)*req.Limit) + sess := userDb.Db.Limit(req.Limit, (req.Page-1)*req.Limit) sess.Where("1=1") if req.Phone != "" { - sess.And("user.phone like ?", "%"+req.Phone+"%") + sess.And("phone like ?", "%"+req.Phone+"%") } if req.Nickname != "" { - sess.And("user.nickname like ?", "%"+req.Nickname+"%") + sess.And("nickname like ?", "%"+req.Nickname+"%") } if req.CreateTimeStart != "" { - sess.And("user.create_at >= ?", req.CreateTimeStart) + sess.And("create_at >= ?", req.CreateTimeStart) } if req.CreateTimeEnd != "" { - sess.And("user.create_at <= ?", req.CreateTimeEnd) + sess.And("create_at <= ?", req.CreateTimeEnd) } resp.Total, err = sess.Desc("user.id").FindAndCount(&m) if err != nil {