order.go 1005 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package cygx
  2. import (
  3. "errors"
  4. "fmt"
  5. "hongze/hz_crm_api/models/cygx"
  6. "hongze/hz_crm_api/services/alarm_msg"
  7. "hongze/hz_crm_api/utils"
  8. )
  9. // GetCygxUserBusinessCardMap 获取手机号对应的邀请人
  10. func GetCygxUserBusinessCardMap(mobileArr []string) (mapResp map[string]string) {
  11. lenArr := len(mobileArr)
  12. if lenArr == 0 {
  13. return
  14. }
  15. var err error
  16. defer func() {
  17. if err != nil {
  18. fmt.Println(err)
  19. go alarm_msg.SendAlarmMsg("获取手机号对应的邀请人,信息失败,GetCygxUserBusinessCardMap Err:"+err.Error(), 3)
  20. }
  21. }()
  22. var condition string
  23. var pars []interface{}
  24. condition = ` AND mobile IN (` + utils.GetOrmInReplace(lenArr) + `)`
  25. pars = append(pars, mobileArr)
  26. list, e := cygx.GetCygxUserBusinessCardList(condition, pars, 0, lenArr)
  27. if e != nil && e.Error() != utils.ErrNoRow() {
  28. err = errors.New("GetArticlList, Err: " + e.Error())
  29. return
  30. }
  31. mapResp = make(map[string]string, 0)
  32. for _, v := range list {
  33. mapResp[v.Mobile] = v.InviteName
  34. }
  35. return
  36. }