kobe6258 8 сар өмнө
parent
commit
6cef6692b0
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      services/sys_user.go

+ 3 - 0
services/sys_user.go

@@ -15,6 +15,9 @@ func GetSysUserList(condition string, pars []interface{}, startSize, pageSize in
 	}
 	departmentIdToName := make(map[models.DepartmentType]map[int]string)
 	for _, dep := range departmentList {
+		if _, ok := departmentIdToName[dep.Type]; !ok {
+			departmentIdToName[dep.Type] = make(map[int]string)
+		}
 		departmentIdToName[dep.Type][dep.OutId] = dep.SysDepartmentName
 	}
 	// 匹配系统用户