user_remind.go 994 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. // 根据用户ID获取那些用户设置了互动提醒
  10. func GetCygxUserRemindListMap(userIds []int) (mapResp map[int]bool) {
  11. lenArr := len(userIds)
  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("根据用户ID获取那些用户设置了互动提醒,信息失败,GetCygxUserRemindListMap Err:"+err.Error(), 3)
  20. }
  21. }()
  22. var condition string
  23. var pars []interface{}
  24. condition = ` AND user_id IN (` + utils.GetOrmInReplace(lenArr) + `)`
  25. pars = append(pars, userIds)
  26. //获取分类名称
  27. userRemindList, e := cygx.GetCygxUserRemindList(condition, pars, 0, 0)
  28. if e != nil {
  29. err = errors.New("GetCygxUserRemindList, Err: " + e.Error())
  30. return
  31. }
  32. mapResp = make(map[int]bool, 0)
  33. for _, v := range userRemindList {
  34. mapResp[v.UserId] = true
  35. }
  36. return
  37. }