1
This commit is contained in:
parent
d8bfbd5657
commit
6a8b21d857
42
server/imserver/cache/cachemgr.go
vendored
42
server/imserver/cache/cachemgr.go
vendored
@ -188,21 +188,33 @@ func (this *cacheMgr) AsyncRecommendList(recommendType int32, accountId string,
|
|||||||
if recommendType == constant.RECOMMEND_TYPE_BATTLE {
|
if recommendType == constant.RECOMMEND_TYPE_BATTLE {
|
||||||
GetPlayerMgr().GetRecommendPlayers(excludeHums, outHums, 3)
|
GetPlayerMgr().GetRecommendPlayers(excludeHums, outHums, 3)
|
||||||
} else if recommendType == constant.RECOMMEND_TYPE_RECENT_GAME {
|
} else if recommendType == constant.RECOMMEND_TYPE_RECENT_GAME {
|
||||||
f5.GetJsStyleDb().PageQuery(
|
f5.GetJsStyleDb().PageQuery(
|
||||||
constant.FRIEND_DB,
|
constant.FRIEND_DB,
|
||||||
5,
|
5,
|
||||||
0,
|
0,
|
||||||
"SELECT * FROM t_recent_battle WHERE 1=1",
|
"SELECT * FROM t_recent_battle WHERE 1=1",
|
||||||
[]string{},
|
[]string{},
|
||||||
f5.GetDbFilter().Comp(
|
f5.GetDbFilter().Comp(
|
||||||
f5.GetDbFilter().GT("idx", q5.ToString(0)).And(),
|
f5.GetDbFilter().GT("idx", q5.ToString(0)).And(),
|
||||||
f5.GetDbFilter().Like("account_id1", q5.ToString(accountId)).Or(),
|
f5.GetDbFilter().Like("account_id1", q5.ToString(accountId)).Or(),
|
||||||
f5.GetDbFilter().Like("account_id2", q5.ToString(accountId)),
|
f5.GetDbFilter().Like("account_id2", q5.ToString(accountId)),
|
||||||
),
|
),
|
||||||
"ORDER BY last_battle_time DESC",
|
"ORDER BY last_battle_time DESC",
|
||||||
func (err error, pg *f5.Pagination) {
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user