1
This commit is contained in:
parent
c64e930a6d
commit
f47c300e8c
@ -1,7 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once('models/Transaction.php');
|
||||||
|
|
||||||
|
require_once('services/BlockChainService.php');
|
||||||
|
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
|
|
||||||
|
use models\Transaction;
|
||||||
|
use services\BlockChainService;
|
||||||
|
|
||||||
class OutAppPlanetController extends BaseController {
|
class OutAppPlanetController extends BaseController {
|
||||||
|
|
||||||
public function buy()
|
public function buy()
|
||||||
@ -9,6 +16,24 @@ class OutAppPlanetController extends BaseController {
|
|||||||
$netId = getReqVal('net_id', '');
|
$netId = getReqVal('net_id', '');
|
||||||
$address = getReqVal('address', '');
|
$address = getReqVal('address', '');
|
||||||
$num = getReqVal('num', '');
|
$num = getReqVal('num', '');
|
||||||
|
|
||||||
|
$decimals = BlockChainService::getCurrencyDecimals(BlockChainService::CURRENCY_USDT);
|
||||||
|
if ($decimals === false) {
|
||||||
|
myself()->_rspErr(1, 'deciamls error');
|
||||||
|
returna;
|
||||||
|
}
|
||||||
|
|
||||||
|
$price = BlockChainService::formatCurrencyEx(1, $decimals);
|
||||||
|
$rspObj = BlockChainService::beNftMallTransBuyPlanet(
|
||||||
|
Transaction::BUY_OUTAPP_PLANET_ACTION_TYPE,
|
||||||
|
$address,
|
||||||
|
array(
|
||||||
|
'280001'
|
||||||
|
),
|
||||||
|
BlockChainService::CURRENCY_USDT,
|
||||||
|
$price
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ class BlockChainService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function beNftMallTransBuyPlanet($address, $ids, $currency, $price)
|
public static function beNftMallTransBuyPlanet($actionType, $address, $ids, $currency, $price)
|
||||||
{
|
{
|
||||||
if (!($actionType > Transaction::BUY_BEGIN_ACTION_TYPE &&
|
if (!($actionType > Transaction::BUY_BEGIN_ACTION_TYPE &&
|
||||||
$actionType < Transaction::BUY_END_ACTION_TYPE)) {
|
$actionType < Transaction::BUY_END_ACTION_TYPE)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user