1
This commit is contained in:
parent
4effb246ba
commit
57a08ec9eb
@ -1,12 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once('models/Nft.php');
|
||||||
require_once('models/Transaction.php');
|
require_once('models/Transaction.php');
|
||||||
|
|
||||||
require_once('services/BlockChainService.php');
|
require_once('services/BlockChainService.php');
|
||||||
|
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
|
|
||||||
|
use models\Nft;
|
||||||
use models\Transaction;
|
use models\Transaction;
|
||||||
|
|
||||||
use services\BlockChainService;
|
use services\BlockChainService;
|
||||||
|
|
||||||
class OutAppPlanetController extends BaseController {
|
class OutAppPlanetController extends BaseController {
|
||||||
@ -60,7 +63,7 @@ class OutAppPlanetController extends BaseController {
|
|||||||
}
|
}
|
||||||
for ($i = 0; $i < $num; ++$i) {
|
for ($i = 0; $i < $num; ++$i) {
|
||||||
array_push($ids, $nftList[$i]);
|
array_push($ids, $nftList[$i]);
|
||||||
$data[$nftList] = myself()->_getNowTime();
|
$data[$nftList[$i]] = myself()->_getNowTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$price = BlockChainService::formatCurrencyEx(self::PRICE * count($ids), $decimals);
|
$price = BlockChainService::formatCurrencyEx(self::PRICE * count($ids), $decimals);
|
||||||
@ -86,12 +89,21 @@ class OutAppPlanetController extends BaseController {
|
|||||||
if (empty($rawData)) {
|
if (empty($rawData)) {
|
||||||
return array();
|
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)
|
private function save($period, $data)
|
||||||
{
|
{
|
||||||
myself()->_getRedis('')->get(PLANET_BUY_KEY . $period, json_encode($data));
|
myself()->_getRedis('')->get(PLANET_BUY_KEY . $period, json_encode($data));
|
||||||
|
myself()->_getRedis('')->pexpire(PLANET_BUY_KEY . $period, 1000 * 3600 * 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user