admin.go 669 B

1234567891011121314151617181920212223242526272829303132
  1. package services
  2. import "hongze/hongze_cygx/models"
  3. func GetAdminMobileMap() (mapItem map[string]string, err error) {
  4. adminList, e := models.GetAdminByRole()
  5. if e != nil {
  6. err = e
  7. return
  8. }
  9. mapMobile := make(map[string]string)
  10. for _, v := range adminList {
  11. mapMobile[v.Mobile] = v.Mobile
  12. }
  13. mapItem = mapMobile
  14. return
  15. }
  16. func GetActivityCcustomerTypeList() (mapItem map[int]string, err error) {
  17. list, e := models.GetActivityCcustomerTypeList()
  18. if e != nil {
  19. err = e
  20. return
  21. }
  22. mapUserType := make(map[int]string)
  23. for _, v := range list {
  24. mapUserType[v.CustomerTypeId] = v.PermissionValue
  25. }
  26. mapUserType[0] = "0"
  27. mapItem = mapUserType
  28. return
  29. }