wechat.go 448 B

12345678910111213141516171819202122
  1. package services
  2. import (
  3. "fmt"
  4. "hongze/hz_crm_api/models"
  5. "time"
  6. )
  7. // 获取所有关注公众号的用户open_id
  8. func GetWxUsersSubscribe() {
  9. openIdList := models.WxUsersGetV1()
  10. fmt.Println("openIdList:", len(openIdList))
  11. time.Sleep(3 * time.Second)
  12. for _, v := range openIdList {
  13. fmt.Println("openId:" + v)
  14. err := models.SetUserSubscribe(v)
  15. if err != nil {
  16. fmt.Println("SetUserSubscribe Err:" + err.Error())
  17. return
  18. }
  19. }
  20. }