用户搜索 手机号,状态 查询条件的添加

This commit is contained in:
zhangwenjian committed 2020-04-22 22:28:44 +08:00
1 parent e1cf38adf9
commit 81dd53b3fd
2 files changed
+9

No files matched your search

+2
View File
@@ -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)
+7
View File
@@ -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)+"%")