From d8bfbd5657afd82287dcff9e8cbf19a1b403b147 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 15 Apr 2024 20:29:57 +0800 Subject: [PATCH] 1 --- server/imserver/cache/cachemgr.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/imserver/cache/cachemgr.go b/server/imserver/cache/cachemgr.go index a838ae21..61dee41b 100644 --- a/server/imserver/cache/cachemgr.go +++ b/server/imserver/cache/cachemgr.go @@ -183,11 +183,26 @@ func (this *cacheMgr) AsyncSearch(sinceId int64, q string, pbUsers *[]*cs.MFUser func (this *cacheMgr) AsyncRecommendList(recommendType int32, accountId string, pbUsers *[]*cs.MFUser, cb func(int32, string)) { excludeHums := make(map[string]int32) + excludeHums[accountId] = 1 outHums := make(map[string]int32) if recommendType == constant.RECOMMEND_TYPE_BATTLE { GetPlayerMgr().GetRecommendPlayers(excludeHums, outHums, 3) } else if recommendType == constant.RECOMMEND_TYPE_RECENT_GAME { + 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) { + }) } }