morning_meeting.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. //func init() {
  10. // fmt.Println(GetCygxMorningMeetingReviewChapterHistoryPvUvMap([]int{111}))
  11. //}
  12. // 根据ID获取pvUv
  13. func GetCygxMorningMeetingReviewChapterHistoryPvUvMap(articleIdArr []int) (mapPvResp, mapUvResp map[int]int) {
  14. lenArr := len(articleIdArr)
  15. if lenArr == 0 {
  16. return
  17. }
  18. var err error
  19. defer func() {
  20. if err != nil {
  21. fmt.Println(err)
  22. go alarm_msg.SendAlarmMsg("根据文章ID获取文章行业分类,信息失败,GetCygxArticlePerssionNameListMap Err:"+err.Error(), 3)
  23. }
  24. }()
  25. var condition string
  26. var pars []interface{}
  27. condition = ` AND meeting_id IN (` + utils.GetOrmInReplace(lenArr) + `)`
  28. pars = append(pars, articleIdArr)
  29. list, e := cygx.GetCygxMorningMeetingReviewChapterHistoryPvUv(condition, pars)
  30. if e != nil && e.Error() != utils.ErrNoRow() {
  31. err = errors.New("GetArticlList, Err: " + e.Error())
  32. return
  33. }
  34. mapPvResp = make(map[int]int, 0)
  35. mapUvResp = make(map[int]int, 0)
  36. for _, v := range list {
  37. mapPvResp[v.ArticleId] = v.Pv
  38. mapUvResp[v.ArticleId] = v.Uv
  39. }
  40. return
  41. }