1
This commit is contained in:
parent
d424d444e0
commit
ce97612a7f
@ -30,7 +30,8 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
public function _handlePre()
|
public function _handlePre()
|
||||||
{
|
{
|
||||||
parent::_handlePre();
|
parent::_handlePre();
|
||||||
if (getReqVal('a') != 'getTransactionList') {
|
if (getReqVal('a', '') != 'getTransactionList' &&
|
||||||
|
myself()->_getChannel() != BC_CHANNEL) {
|
||||||
die(json_encode(array(
|
die(json_encode(array(
|
||||||
'errcode' => 501,
|
'errcode' => 501,
|
||||||
'errmsg' => 'you are not a wallet user'
|
'errmsg' => 'you are not a wallet user'
|
||||||
@ -148,12 +149,12 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
switch ($itemMeta['type']) {
|
switch ($itemMeta['type']) {
|
||||||
case mt\Item::FRAGMENT_BOX_TYPE:
|
case mt\Item::FRAGMENT_BOX_TYPE:
|
||||||
{
|
{
|
||||||
$this->internalOpenChipBox($itemDb, $num);
|
$this->internalOpenFragmentBox($itemDb, $num);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case mt\Item::CHIP_BOX_TYPE:
|
case mt\Item::CHIP_BOX_TYPE:
|
||||||
{
|
{
|
||||||
$this->internalOpenFragmentBox($itemDb, $num);
|
$this->internalOpenChipBox($itemDb, $num);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -248,12 +249,13 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
error_log($response);
|
error_log($response);
|
||||||
|
$tokenType = Nft::CHIP_TYPE;
|
||||||
$rspObj = json_decode($response, true);
|
$rspObj = json_decode($response, true);
|
||||||
if ($rspObj['errcode'] == 0) {
|
if ($rspObj['errcode'] == 0) {
|
||||||
$transId = $rspObj['trans_id'];
|
$transId = $rspObj['trans_id'];
|
||||||
Transaction::add(
|
Transaction::add(
|
||||||
$transId,
|
$transId,
|
||||||
Transaction::MINT_721_ACTION_TYPE,
|
Transaction::MINT_1155_ACTION_TYPE,
|
||||||
$tokenId,
|
$tokenId,
|
||||||
$tokenType,
|
$tokenType,
|
||||||
$itemUniId,
|
$itemUniId,
|
||||||
@ -271,15 +273,16 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function internalOpenFragmentBox($itemDb, $num) {
|
private function internalOpenFragmentBox($itemDb, $num) {
|
||||||
|
$tokenId = $itemDb['item_id'];
|
||||||
$params = array(
|
$params = array(
|
||||||
'c' => 'BcService',
|
'c' => 'BcService',
|
||||||
'a' => 'mintShardBatchUser',
|
'a' => 'mintShardBatchUser',
|
||||||
'account_id' => myself()->_getAccountId(),
|
'account_id' => myself()->_getAccountId(),
|
||||||
'session_id' => myself()->_getSessionId(),
|
'session_id' => myself()->_getSessionId(),
|
||||||
'account' => myself()->_getOpenId(),
|
'account' => myself()->_getOpenId(),
|
||||||
'token_id' => $itemDb['item_id'],
|
'token_id' => $tokenId,
|
||||||
'item_uniid' => $itemUniId,
|
'item_uniid' => $itemDb['item_uniid'],
|
||||||
'item_id' => $itemId,
|
'item_id' => $itemDb['item_id'],
|
||||||
'num' => $num
|
'num' => $num
|
||||||
);
|
);
|
||||||
{
|
{
|
||||||
@ -294,16 +297,17 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
error_log($response);
|
error_log($response);
|
||||||
|
$tokenType = Nft::FRAGMENT_TYPE;
|
||||||
$rspObj = json_decode($response, true);
|
$rspObj = json_decode($response, true);
|
||||||
if ($rspObj['errcode'] == 0) {
|
if ($rspObj['errcode'] == 0) {
|
||||||
$transId = $rspObj['trans_id'];
|
$transId = $rspObj['trans_id'];
|
||||||
Transaction::add(
|
Transaction::add(
|
||||||
$transId,
|
$transId,
|
||||||
Transaction::MINT_721_ACTION_TYPE,
|
Transaction::MINT_SHARD_BATCH_ACTION_TYPE,
|
||||||
$tokenId,
|
$tokenId,
|
||||||
$tokenType,
|
$tokenType,
|
||||||
$itemUniId,
|
$itemDb['item_uniid'],
|
||||||
$itemId
|
$itemDb['item_id']
|
||||||
);
|
);
|
||||||
myself()->_rspData(array(
|
myself()->_rspData(array(
|
||||||
'trans_id' => $transId,
|
'trans_id' => $transId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user