1234567891011121314151617181920212223242526 |
- package tencentim_service
-
- import (
- "SCRM/service"
- )
-
- type InfoMap struct {
- Cname string
- Name string
- Image string
- Uid int64
- Identifier string
- }
-
- func GetImUserMap(accountKey []string, userOrgID int64) (infoMap []InfoMap) {
- service.UserReadDB().Table("sgj_user_user_im AS ui").
- Joins("JOIN sgj_user_user AS u ON u.id = ui.user_id").
- Joins("LEFT JOIN sgj_user_customer AS c ON c.user_id = ui.user_id AND c.user_org_id=? and c.status=1 and c.user_id>0 ", userOrgID).
- Where("ui.identifier IN (?)", accountKey).
- Select("ui.identifier, u.username as name, u.avatar as image, c.name as cname, u.id as uid").
- Scan(&infoMap)
-
- return
-
- }
|