diff --git a/apis/system/sysuser.go b/apis/system/sysuser.go index d4886f6..78217f1 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 e7be312..86ab2c6 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)+"%")