1
This commit is contained in:
parent
c58d1684c7
commit
e3e8e95072
@ -63,9 +63,24 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
myself()->_rspErr(1, 'already activated');
|
myself()->_rspErr(1, 'already activated');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$heroDb['active_token_id']) {
|
$tokenId = $heroDb['active_token_id'];
|
||||||
|
if (!$tokenId) {
|
||||||
|
$tokenId = BuyRecord::genOrderId
|
||||||
|
(
|
||||||
|
2006,
|
||||||
|
phpcommon\BC_FUNC_CREATION,
|
||||||
|
myself()->_getNowTime(),
|
||||||
|
myself()->_getOpenId()
|
||||||
|
);
|
||||||
|
Hero::Update($heroDb['hero_uniid'],
|
||||||
|
array(
|
||||||
|
'active_token_id' => $tokenId,
|
||||||
|
'active_count' => function () {
|
||||||
|
return 'active_count + 1';
|
||||||
|
}
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
$this->internalActivate721Nft($tokenId, Nft::HERO_TYPE, $heroDb['hero_uniid'], $heroDb['hero_id']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@ -136,4 +151,16 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function internalActivate721Nft($tokenId, $tokenType, $itemUniId, $itemId)
|
||||||
|
{
|
||||||
|
$params = array(
|
||||||
|
'account_id' => myself()->_getAccountId(),
|
||||||
|
'session_id' => myself()->_getSessionId(),
|
||||||
|
'token_id' => $tokenId,
|
||||||
|
'token_type' => $tokenType,
|
||||||
|
'item_uniid' => $itemUniId,
|
||||||
|
'item_id' => $itemId
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user