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

This commit is contained in:
zhangwenjian
2020-04-22 22:28:44 +08:00
parent e1cf38adf9
commit 81dd53b3fd
2 changed files with 9 additions and 0 deletions
+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)+"%")