diff --git a/webapp/controller/OutAppPlanetController.class.php b/webapp/controller/OutAppPlanetController.class.php index 4980e4bb..6751864a 100644 --- a/webapp/controller/OutAppPlanetController.class.php +++ b/webapp/controller/OutAppPlanetController.class.php @@ -1,12 +1,15 @@ _getNowTime(); + $data[$nftList[$i]] = myself()->_getNowTime(); } } $price = BlockChainService::formatCurrencyEx(self::PRICE * count($ids), $decimals); @@ -86,12 +89,21 @@ class OutAppPlanetController extends BaseController { if (empty($rawData)) { return array(); } - return json_decode($rawData, true); + $data = json_decode($rawData, true); + $newData = array(); + foreach ($data as $key => $val) { + if (myself()->_getNowTime() - $val > 30) { + continue; + } + $newData[$key] = $val; + } + return $newData; } private function save($period, $data) { myself()->_getRedis('')->get(PLANET_BUY_KEY . $period, json_encode($data)); + myself()->_getRedis('')->pexpire(PLANET_BUY_KEY . $period, 1000 * 3600 * 24); } }