1
This commit is contained in:
parent
ae84812eeb
commit
e47870db61
@ -64,13 +64,13 @@ class BlockChain(object):
|
||||
'group': 'BlockChain',
|
||||
'url': 'webapp/index.php?c=BlockChain&a=active721Nft',
|
||||
'params': [
|
||||
['type', 0, '1:英雄 2:枪械 3:芯片'],
|
||||
['type', 0, '1:英雄 2:金砖'],
|
||||
['uniid', '', '唯一id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['trans_id', '', '事务id'],
|
||||
['!params', [''], '合约参数列表'],
|
||||
['trans_req', _common.MFTransactionRequest(), '调用合约参数'],
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1661,3 +1661,11 @@ class MFGameMail(object):
|
||||
['expiretime', 0, '过期时间'],
|
||||
['!attachments', [MFAttachment()], ''],
|
||||
]
|
||||
|
||||
class MFTransactionRequest(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['to', '', '调用的目标合约地址'],
|
||||
['data', '', '包含报文相关的字节字符串'],
|
||||
]
|
||||
|
@ -187,41 +187,6 @@ class BlockChainController extends BaseAuthedController {
|
||||
$this->internalActivate721Nft($tokenId, Nft::EQUIP_TYPE, $gunDb['gun_uniid'], $gunDb['gun_id']);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if (true) {
|
||||
myself()->_rspErr(1, 'cant mint');
|
||||
return;
|
||||
}
|
||||
$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()->_getAddress()
|
||||
);
|
||||
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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user