wechat_send_msg.go 463 B

123456789101112131415161718192021
  1. package models
  2. import (
  3. "rdluck_tools/orm"
  4. )
  5. type OpenIdList struct {
  6. OpenId string
  7. }
  8. func GetOpenIdList() (items []*OpenIdList,err error) {
  9. openIdstr:=WxUsersGet()
  10. sql:=`SELECT open_id FROM wx_user AS wu
  11. INNER JOIN company AS c ON c.company_id = wu.company_id
  12. WHERE wu.open_id IS NOT NULL AND c.type IN (1,2) `
  13. if openIdstr!="" {
  14. sql+=` AND open_id in (`+openIdstr+`) `
  15. }
  16. _,err=orm.NewOrm().Raw(sql).QueryRows(&items)
  17. return
  18. }