1
This commit is contained in:
parent
ca59bdccd1
commit
f1a575e9f0
@ -124,40 +124,36 @@ class BlockChainController extends BaseAuthedController {
|
||||
myself()->_rspErr(1, 'hero not found');
|
||||
return;
|
||||
}
|
||||
$isMint = true;
|
||||
if ($heroDb['token_id'] && $heroDb['activate']) {
|
||||
myself()->_rspErr(1, 'already activated');
|
||||
return;
|
||||
}
|
||||
/*
|
||||
if ($heroDb['state'] == 1) {
|
||||
myself()->_rspErr(1, 'cant mint');
|
||||
return;
|
||||
}*/
|
||||
$tokenId = $heroDb['token_id'];
|
||||
if (!$tokenId) {
|
||||
$tokenId = BuyRecord::genOrderId
|
||||
(
|
||||
GAME_ID,
|
||||
phpcommon\BC_FUNC_CREATION,
|
||||
myself()->_getNowTime(),
|
||||
myself()->_getAddress()
|
||||
);
|
||||
Hero::safeUpdateTokenId($heroDb['hero_uniid'], $tokenId);
|
||||
$heroDb = Hero::find($uniid);
|
||||
if (!$heroDb) {
|
||||
myself()->_rspErr(1, 'hero not found');
|
||||
return;
|
||||
}
|
||||
if ($heroDb['token_id'] != $tokenId) {
|
||||
myself()->_rspErr(500, 'server internal error');
|
||||
return;
|
||||
$isMint = false;
|
||||
} else {
|
||||
$tokenId = $heroDb['token_id'];
|
||||
if (!$tokenId) {
|
||||
$tokenId = BuyRecord::genOrderId
|
||||
(
|
||||
GAME_ID,
|
||||
phpcommon\BC_FUNC_CREATION,
|
||||
myself()->_getNowTime(),
|
||||
myself()->_getAddress()
|
||||
);
|
||||
Hero::safeUpdateTokenId($heroDb['hero_uniid'], $tokenId);
|
||||
$heroDb = Hero::find($uniid);
|
||||
if (!$heroDb) {
|
||||
myself()->_rspErr(1, 'hero not found');
|
||||
return;
|
||||
}
|
||||
if ($heroDb['token_id'] != $tokenId) {
|
||||
myself()->_rspErr(500, 'server internal error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->internalActivate721Nft($tokenId,
|
||||
Nft::HERO_TYPE,
|
||||
$heroDb['hero_uniid'],
|
||||
$heroDb['hero_id'],
|
||||
true);
|
||||
$isMint);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -204,7 +200,7 @@ class BlockChainController extends BaseAuthedController {
|
||||
'token_type' => $tokenType,
|
||||
'item_uniid' => $itemUniId,
|
||||
'item_id' => $itemId,
|
||||
'is_mint' => $isMint,
|
||||
'is_mint' => $isMint ? 1 : 0,
|
||||
'net_id' => NET_ID
|
||||
);
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user