用户搜索 手机号,状态 查询条件的添加
This commit is contained in:
1 parent
e1cf38adf9
commit
81dd53b3fd
2 files changed
+9
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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)+"%")
|
||||
|
||||
Reference in new issue
Block a user