Merge branch 'james_bc' of git.kingsome.cn:server/game2006api into james_bc
This commit is contained in:
commit
706fa58902
@ -103,7 +103,28 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
myself()->_rspErr(1, 'gun not found');
|
myself()->_rspErr(1, 'gun not found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ($gunDb['token_id']) {
|
||||||
|
myself()->_rspErr(1, 'already activated');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$tokenId = $gunDb['active_token_id'];
|
||||||
|
if (!$tokenId) {
|
||||||
|
$tokenId = BuyRecord::genOrderId
|
||||||
|
(
|
||||||
|
2006,
|
||||||
|
phpcommon\BC_FUNC_CREATION,
|
||||||
|
myself()->_getNowTime(),
|
||||||
|
myself()->_getOpenId()
|
||||||
|
);
|
||||||
|
Gun::Update($gunDb['gun_uniid'],
|
||||||
|
array(
|
||||||
|
'active_token_id' => $tokenId,
|
||||||
|
'active_count' => function () {
|
||||||
|
return 'active_count + 1';
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
$this->internalActivate721Nft($tokenId, Nft::GUN_TYPE, $gunDb['gun_uniid'], $gunDb['gun_id']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -135,7 +156,7 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
{
|
{
|
||||||
$nft1 = Hero::findByTokenId($tokenId1);
|
$nft1 = Hero::findByTokenId($tokenId1);
|
||||||
$nft2 = Hero::findByTokenId($tokenId2);
|
$nft2 = Hero::findByTokenId($tokenId2);
|
||||||
if (!$nft1 || $nft2) {
|
if (!$nft1 || !$nft2) {
|
||||||
myself()->_rspErr(1, 'token paramater error');
|
myself()->_rspErr(1, 'token paramater error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -153,7 +174,7 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
array(
|
array(
|
||||||
'action' => Transaction::EVOLVE_721_ACTION_TYPE,
|
'action' => Transaction::EVOLVE_721_ACTION_TYPE,
|
||||||
'tokenId' => $nft1['token_id'],
|
'tokenId' => $nft1['token_id'],
|
||||||
'itemType' => $type,
|
'tokenType' => Nft::HERO_TYPE,
|
||||||
'itemUniId' => $nft1['hero_uniid'],
|
'itemUniId' => $nft1['hero_uniid'],
|
||||||
'itemId' => $nft1['hero_id']
|
'itemId' => $nft1['hero_id']
|
||||||
)
|
)
|
||||||
@ -164,7 +185,7 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
{
|
{
|
||||||
$nft1 = Gun::findByTokenId($tokenId1);
|
$nft1 = Gun::findByTokenId($tokenId1);
|
||||||
$nft2 = Gun::findByTokenId($tokenId2);
|
$nft2 = Gun::findByTokenId($tokenId2);
|
||||||
if (!$nft1 || $nft2) {
|
if (!$nft1 || !$nft2) {
|
||||||
myself()->_rspErr(1, 'token paramater error');
|
myself()->_rspErr(1, 'token paramater error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -182,7 +203,7 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
array(
|
array(
|
||||||
'action' => Transaction::EVOLVE_721_ACTION_TYPE,
|
'action' => Transaction::EVOLVE_721_ACTION_TYPE,
|
||||||
'tokenId' => $nft1['token_id'],
|
'tokenId' => $nft1['token_id'],
|
||||||
'itemType' => $type,
|
'tokenType' => Nft::GUN_TYPE,
|
||||||
'itemUniId' => $nft1['gun_uniid'],
|
'itemUniId' => $nft1['gun_uniid'],
|
||||||
'itemId' => $nft1['gun_id']
|
'itemId' => $nft1['gun_id']
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user