This commit is contained in:
aozhiwei 2022-11-04 11:35:01 +08:00
parent 3c635ed188
commit f489a12fd3

View File

@ -126,22 +126,65 @@ class BlockChainController extends BaseAuthedController {
public function evolve721Nft()
{
$type = getReqVal('type', '');
$tokenId1 = getReqVal('token_id1', '');
$tokenId2 = getReqVal('token_id2', '');
switch ($type) {
case 1:
{
$tokenId1 = getReqVal('token_id1', '');
$tokenId2 = getReqVal('token_id2', '');
$nft1 = Hero::findByTokenId($tokenId1);
$nft2 = Hero::findByTokenId($tokenId2);
if (!$nft1 || $nft2) {
myself()->_rspErr(1, 'token paramater error');
return;
}
$this->internalBcCall(
array(
'c' => 'BcService',
'a' => 'evolve721Nft',
'account_id' => myself()->_getAccountId(),
'session_id' => myself()->_getSessionId(),
'account' => myself()->_getOpenId(),
'type' => $type,
'token_id1' => $tokenId1,
'token_id2' => $tokenId2
),
array(
'action' => Transaction::EVOLVE_721_ACTION_TYPE,
'tokenId' => '',
'itemType' => $type,
'itemUniId' => 0,
'itemId' => 0
)
);
}
break;
case 2:
{
$nft1 = Gun::findByTokenId($tokenId1);
$nft2 = Gun::findByTokenId($tokenId2);
if (!$nft1 || $nft2) {
myself()->_rspErr(1, 'token paramater error');
return;
}
$this->internalBcCall(
array(
'c' => 'BcService',
'a' => 'evolve721Nft',
'account_id' => myself()->_getAccountId(),
'session_id' => myself()->_getSessionId(),
'account' => myself()->_getOpenId(),
'type' => $type,
'token_id1' => $tokenId1,
'token_id2' => $tokenId2
),
array(
'action' => Transaction::EVOLVE_721_ACTION_TYPE,
'tokenId' => '',
'itemType' => $type,
'itemUniId' => 0,
'itemId' => 0
)
);
}
break;
default: