From 57a08ec9ebe47b3bbf8c1219c4ab928c61753cad Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 1 Sep 2023 14:04:56 +0800 Subject: [PATCH] 1 --- .../controller/OutAppPlanetController.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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); } }