From f489a12fd35fa760e487dcea14714f18349753d0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 4 Nov 2022 11:35:01 +0800 Subject: [PATCH] 1 --- .../controller/BlockChainController.class.php | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index 28987f82..6b8d422d 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -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: