This commit is contained in:
aozhiwei 2023-09-01 13:19:20 +08:00
parent 7edd9c4049
commit c7e9f9f504
2 changed files with 15 additions and 0 deletions

View File

@ -3,6 +3,7 @@
define('TEAMID_KEY', 'team_uuid:');
define('RANKING_KEY', 'game2006api:');
define('DAILY_SELECTION_KEY', 'game2006api:daily_selection:');
define('PLANET_BUY_KEY', 'game2006api:planet_buy:');
define('LAST_SESSION_KEY', 'last_session:');

View File

@ -50,4 +50,18 @@ class OutAppPlanetController extends BaseController {
}
private function load($period)
{
$rawData = myself()->_getRedis('')->get(PLANET_BUY_KEY . $period);
if (empty($rawData)) {
return array();
}
return json_decode($rawData, true);
}
private function save($data)
{
myself()->_getRedis('')->get(PLANET_BUY_KEY . $period, json_encode($data));
}
}