|
@@ -330,20 +330,30 @@ func (this *SysUserController) List() {
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
roleId, _ := this.GetInt("RoleId")
|
|
|
+ //Type := this.GetString("Type")
|
|
|
+ Level, _ := this.GetInt("Level")
|
|
|
departmentId, _ := this.GetInt("DepartmentId")
|
|
|
keyWord := this.GetString("KeyWord")
|
|
|
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
-
|
|
|
+ if Level > 4 || Level < 1 {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = fmt.Sprintf("获取失败,组织架构等级错误,不能小于1级或者超过4级,当前等级:%d", Level)
|
|
|
+ return
|
|
|
+ }
|
|
|
if roleId > 0 {
|
|
|
condition += ` AND sys_role_id=? `
|
|
|
pars = append(pars, roleId)
|
|
|
}
|
|
|
-
|
|
|
if departmentId > 0 {
|
|
|
- condition += ` AND (sys_department_id1=? OR sys_department_id2=? OR sys_department_id3=? OR sys_department_id4=?) `
|
|
|
- pars = append(pars, departmentId, departmentId, departmentId, departmentId)
|
|
|
+ if Level == 1 {
|
|
|
+ condition += ` AND (sys_department_id1=?) `
|
|
|
+ } else {
|
|
|
+ queryDepartment := fmt.Sprintf("sys_department_id%d", Level)
|
|
|
+ condition += fmt.Sprintf(` AND %s=?`, queryDepartment)
|
|
|
+ }
|
|
|
+ pars = append(pars, departmentId)
|
|
|
}
|
|
|
|
|
|
if keyWord != "" {
|