|
|
|
|
@ -691,11 +691,11 @@ func AddGameRecord(uid int, provider int, gameId int) error { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// GetGameRecord 获取游玩记录
|
|
|
|
|
func GetGameRecord(uid int) (gameList []*common.ConfigGameList) { |
|
|
|
|
func GetGameRecord(uid, num int) (gameList []*common.ConfigGameList) { |
|
|
|
|
client := db.Redis().GetRedis() |
|
|
|
|
ctx := context.Background() |
|
|
|
|
playerGamesListKey := fmt.Sprintf("player:%d:games:list", uid) |
|
|
|
|
games, err := client.LRange(ctx, playerGamesListKey, 0, -1).Result() |
|
|
|
|
games, err := client.LRange(ctx, playerGamesListKey, 0, int64(num)).Result() |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error("GetGameRecord LRange uid:%v,err:%v", uid, err) |
|
|
|
|
return nil |
|
|
|
|
@ -739,9 +739,9 @@ func DelPlayerFavorite(uid int, provider int, gameId int) error { |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func GetPlayerFavoriteList(uid int) (gameList []*common.ConfigGameList) { |
|
|
|
|
func GetPlayerFavoriteList(uid, num int) (gameList []*common.ConfigGameList) { |
|
|
|
|
var ret []*common.PlayerFavorite |
|
|
|
|
_, err := db.Mysql().QueryAll(fmt.Sprintf("uid = %v", uid), "create_at", &common.PlayerFavorite{}, &ret) |
|
|
|
|
_, err := db.Mysql().QueryList(0, num, fmt.Sprintf("uid = %v", uid), "create_at", &common.PlayerFavorite{}, &ret) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error("GetPlayerFavoriteList Delete uid:%v,err:%v", uid, err) |
|
|
|
|
return |
|
|
|
|
|