Commit 379a33a6 authored by hujiebin's avatar hujiebin

Update userManager.go

parent 338e5167
...@@ -99,6 +99,7 @@ func (m *UserManager) GetArea(country string) (area int8) { ...@@ -99,6 +99,7 @@ func (m *UserManager) GetArea(country string) (area int8) {
type UserTinyArea struct { type UserTinyArea struct {
ID uint64 ID uint64
Avatar string
ExternalId string ExternalId string
Sex uint8 Sex uint8
Code string Code string
...@@ -112,7 +113,7 @@ func (m *UserManager) GetAreaUsers(userIds []uint64, area int8) map[uint64]UserT ...@@ -112,7 +113,7 @@ func (m *UserManager) GetAreaUsers(userIds []uint64, area int8) map[uint64]UserT
// 从db中读,暂时不缓存(几千个) // 从db中读,暂时不缓存(几千个)
var users []UserTinyArea var users []UserTinyArea
if err := m.MysqlDB.Table("user"). if err := m.MysqlDB.Table("user").
Select("id,external_id,sex,code,country"). Select("id,external_id,sex,code,country,avatar").
Where("id IN (?)", userIds).Find(&users).Error; err != nil { Where("id IN (?)", userIds).Find(&users).Error; err != nil {
mylogrus.MyLog.Errorf("GetUserArea fail:%v", err) mylogrus.MyLog.Errorf("GetUserArea fail:%v", err)
return res return res
...@@ -129,6 +130,7 @@ func (m *UserManager) GetAreaUsers(userIds []uint64, area int8) map[uint64]UserT ...@@ -129,6 +130,7 @@ func (m *UserManager) GetAreaUsers(userIds []uint64, area int8) map[uint64]UserT
Code: u.Code, Code: u.Code,
Country: u.Country, Country: u.Country,
Area: a, Area: a,
Avatar: u.Avatar,
} }
} }
return res return res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment