wx_template_msg.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package models
  2. type SendTemplateResponse struct {
  3. Errcode int `json:"errcode"`
  4. Errmsg string `json:"errmsg"`
  5. MsgID int `json:"msgid"`
  6. }
  7. type OpenIdList struct {
  8. OpenId string
  9. }
  10. // GetOpenIdArrByClassifyId
  11. // @Description: 根据分类id获取关联的用户微信openid
  12. // @author: Roc
  13. // @datetime 2024-06-28 14:57:27
  14. // @param classifyId int
  15. // @return items []string
  16. // @return err error
  17. func GetOpenIdArrByClassifyId(classifyId int) (items []string, err error) {
  18. //sql := ` SELECT DISTINCT ur.open_id FROM wx_user AS wu
  19. // INNER JOIN company AS c ON c.company_id = wu.company_id
  20. // INNER JOIN company_product AS d ON c.company_id=d.company_id
  21. // INNER JOIN user_record AS ur ON wu.user_id=ur.user_id
  22. // INNER JOIN company_report_permission AS e ON d.company_id=e.company_id
  23. // INNER JOIN chart_permission AS f ON e.chart_permission_id=f.chart_permission_id
  24. // INNER JOIN chart_permission_search_key_word_mapping AS g ON f.chart_permission_id=g.chart_permission_id
  25. // WHERE ur.open_id != "" AND ur.subscribe=1 AND ur.create_platform=1 AND d.status IN('正式','试用','永续') AND e.status IN('正式','试用','永续')
  26. // AND g.from='rddp'
  27. // AND g.classify_id=?
  28. // ORDER BY FIELD(c.company_id, 16) DESC, ur.user_record_id ASC `
  29. //o := orm.NewOrmUsingDB("weekly")
  30. //_, err = o.Raw(sql, classifyId).QueryRows(&items)
  31. return
  32. }