user_service.go 668B

1234567891011121314151617181920212223242526
  1. package tencentim_service
  2. import (
  3. "SCRM/service"
  4. )
  5. type InfoMap struct {
  6. Cname string
  7. Name string
  8. Image string
  9. Uid int64
  10. Identifier string
  11. }
  12. func GetImUserMap(accountKey []string, userOrgID int64) (infoMap []InfoMap) {
  13. service.UserReadDB().Table("sgj_user_user_im AS ui").
  14. Joins("JOIN sgj_user_user AS u ON u.id = ui.user_id").
  15. 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).
  16. Where("ui.identifier IN (?)", accountKey).
  17. Select("ui.identifier, u.username as name, u.avatar as image, c.name as cname, u.id as uid").
  18. Scan(&infoMap)
  19. return
  20. }