From 81dd53b3fd3915e4a08692f927b46ac925a12e30 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Wed, 22 Apr 2020 22:28:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=90=9C=E7=B4=A2=20?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=EF=BC=8C=E7=8A=B6=E6=80=81=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E7=9A=84=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/system/sysuser.go | 2 ++ models/sysuser.go | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/apis/system/sysuser.go b/apis/system/sysuser.go index d4886f68..78217f1c 100644 --- a/apis/system/sysuser.go +++ b/apis/system/sysuser.go @@ -35,6 +35,8 @@ func GetSysUserList(c *gin.Context) { } data.Username = c.Request.FormValue("userName") + data.Status = c.Request.FormValue("status") + data.Phone = c.Request.FormValue("phone") postId := c.Request.FormValue("postId") data.PostId, _ = tools.StringToInt(postId) diff --git a/models/sysuser.go b/models/sysuser.go index e7be3123..86ab2c63 100644 --- a/models/sysuser.go +++ b/models/sysuser.go @@ -131,6 +131,13 @@ func (e *SysUser) GetPage(pageSize int, pageIndex int) ([]SysUserPage, int, erro if e.Username != "" { table = table.Where("username = ?", e.Username) } + if e.Status != "" { + table = table.Where("sys_user.status = ?", e.Status) + } + + if e.Phone != "" { + table = table.Where("sys_user.phone = ?", e.Phone) + } if e.DeptId != 0 { table = table.Where("sys_user.dept_id in (select dept_id from sys_dept where dept_path like ? )", "%"+tools.IntToString(e.DeptId)+"%")