<?php include_once 'helper.php'; include_once 'gamedata.php'; $registerInfo = helper_receiveMsg(); $userId = $registerInfo['userId']; $gameData = new GameData(); $todayRank = $gameData->getScoreRank($userId); if (!$todayRank) { helper_sendMsg(array('ret' => 'error')); exit; } $retMsg = array('ret' => 'ok', 'rank' => $todayRank); helper_sendMsg($retMsg);
<?php include_once 'helper.php'; include_once 'gamedata.php'; $registerInfo = helper_receiveMsg(); $userId = $registerInfo['userId']; $gameData = new GameData(); $dairyRank = $gameData->getScoreRank($userId); if (!$dairyRank) { helper_sendMsg(array('ret' => 'get_rank_failed')); exit; } $retMsg = array('ret' => 'ok', 'rank' => $dairyRank); helper_sendMsg($retMsg);
<?php include_once 'helper.php'; include_once 'gamedata.php'; $userId = "RamboatRamboatRamboat2222"; $gameData = new GameData(); $day = intval(date("w")); if ($day == 0) { $day = 7; } //$yesterdayRank = $gameData->getLastDayRank_redis($userId); $yesterdayRank = $gameData->getScoreRank($userId); if (!$yesterdayRank) { helper_sendMsg(array('ret' => 'error')); exit; } $retMsg = array('ret' => 'ok', 'rank' => $yesterdayRank); echo json_encode($retMsg); ?>