This commit is contained in:
aozhiwei 2023-09-01 13:57:17 +08:00
parent ccd0cfc55a
commit 4effb246ba

View File

@ -11,6 +11,10 @@ use services\BlockChainService;
class OutAppPlanetController extends BaseController { class OutAppPlanetController extends BaseController {
const BEGIN_TOKEN_ID = 280001;
const END_TOKEN_ID = 280300;
const PRICE = 1;
public function buy() public function buy()
{ {
$netId = getReqVal('net_id', ''); $netId = getReqVal('net_id', '');
@ -39,8 +43,8 @@ class OutAppPlanetController extends BaseController {
'SELECT * FROM t_nft WHERE token_type=:token_type AND creator_address = owner_address AND token_id >= :begin_token_id AND token_id <= :end_token_id;', 'SELECT * FROM t_nft WHERE token_type=:token_type AND creator_address = owner_address AND token_id >= :begin_token_id AND token_id <= :end_token_id;',
array( array(
':token_type' => Nft::PLANET_TYPE, ':token_type' => Nft::PLANET_TYPE,
':begin_token_id' => 0, ':begin_token_id' => self::BEGIN_TOKEN_ID,
':end_token_id' => 0 ':end_token_id' => self::END_TOKEN_ID
) )
); );
$nftList = array(); $nftList = array();
@ -59,7 +63,7 @@ class OutAppPlanetController extends BaseController {
$data[$nftList] = myself()->_getNowTime(); $data[$nftList] = myself()->_getNowTime();
} }
} }
$price = BlockChainService::formatCurrencyEx(1 * count($ids), $decimals); $price = BlockChainService::formatCurrencyEx(self::PRICE * count($ids), $decimals);
$rspObj = BlockChainService::beNftMallTransBuyPlanet( $rspObj = BlockChainService::beNftMallTransBuyPlanet(
Transaction::BUY_OUTAPP_PLANET_ACTION_TYPE, Transaction::BUY_OUTAPP_PLANET_ACTION_TYPE,
$address, $address,