1
This commit is contained in:
parent
a9ed8a84cf
commit
ccd0cfc55a
@ -30,6 +30,7 @@ class OutAppPlanetController extends BaseController {
|
|||||||
myself()->_rspErr(1, 'deciamls error');
|
myself()->_rspErr(1, 'deciamls error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$ids = array();
|
||||||
$period = 1;
|
$period = 1;
|
||||||
$data = $this->load($period);
|
$data = $this->load($period);
|
||||||
{
|
{
|
||||||
@ -42,11 +43,22 @@ class OutAppPlanetController extends BaseController {
|
|||||||
':end_token_id' => 0
|
':end_token_id' => 0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$nftList = array();
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
if (!array_key_exists($row['token_id'], $data)) {
|
||||||
|
array_push($nftList, $row['token_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
shuffle($nftList);
|
||||||
|
if (count($nftList) < $num) {
|
||||||
|
myself()->_rspErr(2, 'num error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for ($i = 0; $i < $num; ++$i) {
|
||||||
|
array_push($ids, $nftList[$i]);
|
||||||
|
$data[$nftList] = myself()->_getNowTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ids = array(
|
|
||||||
'280002'
|
|
||||||
);
|
|
||||||
$price = BlockChainService::formatCurrencyEx(1 * count($ids), $decimals);
|
$price = BlockChainService::formatCurrencyEx(1 * count($ids), $decimals);
|
||||||
$rspObj = BlockChainService::beNftMallTransBuyPlanet(
|
$rspObj = BlockChainService::beNftMallTransBuyPlanet(
|
||||||
Transaction::BUY_OUTAPP_PLANET_ACTION_TYPE,
|
Transaction::BUY_OUTAPP_PLANET_ACTION_TYPE,
|
||||||
@ -56,6 +68,7 @@ class OutAppPlanetController extends BaseController {
|
|||||||
$price
|
$price
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->save($period, $data);
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'trans_id' => $rspObj['trans_id'],
|
'trans_id' => $rspObj['trans_id'],
|
||||||
'params' => $rspObj['params'],
|
'params' => $rspObj['params'],
|
||||||
@ -72,7 +85,7 @@ class OutAppPlanetController extends BaseController {
|
|||||||
return json_decode($rawData, true);
|
return json_decode($rawData, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function save($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));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user