123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package services
- import (
- "hongze/hongze_cygx/models"
- "hongze/hongze_cygx/utils"
- )
- func GetAdminMobileMap() (mapItem map[string]string, err error) {
- adminList, e := models.GetAdminByRole()
- 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
- }
|