package models import ( "rdluck_tools/orm" ) type OpenIdList struct { OpenId string } func GetOpenIdList() (items []*OpenIdList,err error) { openIdstr:=WxUsersGet() sql:=`SELECT open_id FROM wx_user AS wu INNER JOIN company AS c ON c.company_id = wu.company_id WHERE wu.open_id IS NOT NULL AND c.type IN (1,2) ` if openIdstr!="" { sql+=` AND open_id in (`+openIdstr+`) ` } _,err=orm.NewOrm().Raw(sql).QueryRows(&items) return }