This commit is contained in:
aozhiwei 2024-06-17 17:40:59 +08:00
parent ca59bdccd1
commit f1a575e9f0

View File

@ -124,15 +124,10 @@ class BlockChainController extends BaseAuthedController {
myself()->_rspErr(1, 'hero not found'); myself()->_rspErr(1, 'hero not found');
return; return;
} }
$isMint = true;
if ($heroDb['token_id'] && $heroDb['activate']) { if ($heroDb['token_id'] && $heroDb['activate']) {
myself()->_rspErr(1, 'already activated'); $isMint = false;
return; } else {
}
/*
if ($heroDb['state'] == 1) {
myself()->_rspErr(1, 'cant mint');
return;
}*/
$tokenId = $heroDb['token_id']; $tokenId = $heroDb['token_id'];
if (!$tokenId) { if (!$tokenId) {
$tokenId = BuyRecord::genOrderId $tokenId = BuyRecord::genOrderId
@ -153,11 +148,12 @@ class BlockChainController extends BaseAuthedController {
return; return;
} }
} }
}
$this->internalActivate721Nft($tokenId, $this->internalActivate721Nft($tokenId,
Nft::HERO_TYPE, Nft::HERO_TYPE,
$heroDb['hero_uniid'], $heroDb['hero_uniid'],
$heroDb['hero_id'], $heroDb['hero_id'],
true); $isMint);
} }
break; break;
default: default:
@ -204,7 +200,7 @@ class BlockChainController extends BaseAuthedController {
'token_type' => $tokenType, 'token_type' => $tokenType,
'item_uniid' => $itemUniId, 'item_uniid' => $itemUniId,
'item_id' => $itemId, 'item_id' => $itemId,
'is_mint' => $isMint, 'is_mint' => $isMint ? 1 : 0,
'net_id' => NET_ID 'net_id' => NET_ID
); );
{ {