1
This commit is contained in:
parent
aadbf4f8fe
commit
756aea2619
30
server/imserver/cache/cachemgr.go
vendored
30
server/imserver/cache/cachemgr.go
vendored
@ -210,8 +210,34 @@ func (this *cacheMgr) AsyncRecommendList(recommendType int32, accountId string,
|
||||
}
|
||||
}
|
||||
if recommendType == constant.RECOMMEND_TYPE_BATTLE {
|
||||
GetPlayerMgr().GetRecommendPlayers(excludeHums, outHums, 5)
|
||||
doFunc()
|
||||
f5.GetJsStyleDb().PageQuery(
|
||||
constant.FRIEND_DB,
|
||||
5,
|
||||
0,
|
||||
"SELECT * FROM t_recent_battle WHERE 1=1",
|
||||
[]string{},
|
||||
f5.GetDbFilter().Comp(
|
||||
f5.GetDbFilter().GT("idx", q5.ToString(0)).And(),
|
||||
f5.GetDbFilter().Like("account_id1", q5.ToString(accountId)).Or(),
|
||||
f5.GetDbFilter().Like("account_id2", q5.ToString(accountId)),
|
||||
),
|
||||
"ORDER BY last_battle_time DESC",
|
||||
func (err error, pg *f5.Pagination) {
|
||||
if err != nil {
|
||||
cb(500, "server internal error")
|
||||
return
|
||||
}
|
||||
for pg.Rows.Next() {
|
||||
accountId1 := pg.Rows.GetByName("account_id1")
|
||||
accountId2 := pg.Rows.GetByName("account_id2")
|
||||
if accountId1 == accountId {
|
||||
outHums[accountId2] = 1
|
||||
} else {
|
||||
outHums[accountId1] = 1
|
||||
}
|
||||
}
|
||||
doFunc()
|
||||
})
|
||||
} else {
|
||||
if recommendType == constant.RECOMMEND_TYPE_ALL {
|
||||
GetPlayerMgr().GetRecommendPlayers(excludeHums, outHums, 5)
|
||||
|
Loading…
x
Reference in New Issue
Block a user