system.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package services
  2. /*func GetCompanyNameByAdmins(adminIds []int) (adminCompanyMap map[int]string, err error) {
  3. // 查询所有机构
  4. ob := new(system.EtaBusiness)
  5. companyList, er := ob.GetItemsByCondition("", make([]interface{}, 0), []string{}, "")
  6. if er != nil {
  7. err = fmt.Errorf("获取机构信息失败 %s", err.Error())
  8. return
  9. }
  10. companyMap := make(map[string]string)
  11. if len(companyList) > 0 {
  12. for _, v := range companyList {
  13. companyMap[v.BusinessCode] = v.BusinessName
  14. }
  15. }
  16. //查询机构下的用户
  17. admin := new(system.Admin)
  18. cond := ` AND admin_id in (` + utils.GetOrmInReplace(len(adminIds)) + `)`
  19. pars := make([]interface{}, 0)
  20. pars = append(pars, adminIds)
  21. adminList, err := admin.GetItemsByCondition(cond, pars, []string{}, "")
  22. if err != nil {
  23. err = fmt.Errorf("获取机构用户失败 %s", err.Error())
  24. return
  25. }
  26. adminCompanyMap = make(map[int]string)
  27. if len(adminList) > 0 {
  28. for _, v := range adminList {
  29. tmp, ok := companyMap[v.BusinessCode]
  30. if ok {
  31. adminCompanyMap[v.AdminId] = tmp
  32. }
  33. }
  34. }
  35. return
  36. }*/