package services import ( "hongze/hongze_cygx/models" "hongze/hongze_cygx/utils" ) func GetAdminMobileMap() (mapItem map[string]string, err error) { adminList, e := models.GetRaiAdmin() if e != nil { err = e return } mapMobile := make(map[string]string) for _, v := range adminList { mapMobile[v.Mobile] = v.Mobile } mapItem = mapMobile return } func GetActivityCcustomerTypeList() (mapItem map[int]string, err error) { list, e := models.GetActivityCcustomerTypeList() if e != nil { err = e return } mapUserType := make(map[int]string) for _, v := range list { mapUserType[v.CustomerTypeId] = v.PermissionValue } mapUserType[0] = "0" mapItem = mapUserType return } // GetRaiAdminMobileMap 获取权益内部人员手机号 func GetRaiAdminMobileMap() (mapItem map[string]string) { var err error defer func() { if err != nil { go utils.SendAlarmMsg("获取权益内部人员手机号失败 ErrMsg:"+err.Error(), 2) } }() adminList, e := models.GetRaiAdmin() if e != nil { err = e return } mapMobile := make(map[string]string) for _, v := range adminList { mapMobile[v.Mobile] = v.Mobile } mapItem = mapMobile return } // 根据手机号判断是否属于权益 func GetBelongingRai(mobile string) (isBelong bool) { mapItem := GetRaiAdminMobileMap() if mapItem[mobile] != "" { isBelong = true } return }