1b
This commit is contained in:
parent
6cc11aa665
commit
c6e3cac572
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user