12345678910111213141516171819 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- )
- type OpenIdList struct {
- OpenId string
- UserId int
- }
- func GetAdminOpenIdByMobile(mobile string) (items []*OpenIdList, err error) {
- sql := `SELECT DISTINCT ur.open_id,wu.user_id FROM wx_user AS wu
- INNER JOIN company AS c ON c.company_id = wu.company_id
- INNER join user_record as ur on wu.user_id=ur.user_id
- WHERE ur.open_id != "" and ur.create_platform=1 AND wu.mobile=? `
- _, err = orm.NewOrm().Raw(sql, mobile).QueryRows(&items)
- return
- }
|