This commit is contained in:
aozhiwei 2023-06-07 15:54:02 +08:00
parent 0db0f994ba
commit be38ed2e1b

View File

@ -179,6 +179,37 @@ class BlockChainController extends BaseAuthedController {
$this->internalActivate721Nft($tokenId, Nft::EQUIP_TYPE, $gunDb['gun_uniid'], $gunDb['gun_id']);
}
break;
case 3:
{
$chipDb = Chip::find($uniid);
if (!$chipDb) {
myself()->_rspErr(1, 'chip not found');
return;
}
if ($chipDb['token_id']) {
myself()->_rspErr(1, 'already activated');
return;
}
$tokenId = $chipDb['active_token_id'];
if (!$tokenId) {
$tokenId = BuyRecord::genOrderId
(
2006,
phpcommon\BC_FUNC_CREATION,
myself()->_getNowTime(),
myself()->_getOpenId()
);
Chip::Update($chipDb['chip_uniid'],
array(
'active_token_id' => $tokenId,
'active_count' => function () {
return 'active_count + 1';
}
));
}
$this->internalActivate721Nft($tokenId, Nft::CHIP_TYPE, $chipDb['chip_uniid'], $chipDb['item_id']);
}
break;
default:
{
myself()->_rspErr(1, 'type param error');