1
This commit is contained in:
parent
26ad10f6d4
commit
828ae97924
@ -409,12 +409,75 @@ class BlockChainController extends BaseAuthedController {
|
||||
switch ($type) {
|
||||
case 1:
|
||||
{
|
||||
$heroDb = Hero::findByTokenId($tokenId);
|
||||
foreach ($chipIds as $chipId) {
|
||||
$chipDb = Chip::findByTokenId($chipId);
|
||||
if (!$chipDb) {
|
||||
myself()->_rspErr(101, 'chip_ids paramater error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!$heroDb) {
|
||||
myself()->_rspErr(101, 'token_id paramater error');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->internalBcCall(
|
||||
array(
|
||||
'c' => 'BcService',
|
||||
'a' => 'unplugChip',
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'session_id' => myself()->_getSessionId(),
|
||||
'account' => myself()->_getOpenId(),
|
||||
'type' => $type,
|
||||
'token_id' => $tokenId,
|
||||
'chip_ids' => implode('|', $chipIds)
|
||||
),
|
||||
array(
|
||||
'action' => Transaction::UNPLUG_CHIP_ACTION_TYPE,
|
||||
'tokenId' => $tokenId,
|
||||
'tokenType' => Nft::HERO_TYPE,
|
||||
'itemUniId' => $heroDb['chip_uniid'],
|
||||
'itemId' => $heroDb['item_id']
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$gunDb = Gun::findByTokenId($tokenId);
|
||||
foreach ($chipIds as $chipId) {
|
||||
$chipDb = Chip::findByTokenId($chipId);
|
||||
if (!$chipDb) {
|
||||
myself()->_rspErr(101, 'chip_ids paramater error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!$gunDb) {
|
||||
myself()->_rspErr(101, 'token_id paramater error');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->internalBcCall(
|
||||
array(
|
||||
'c' => 'BcService',
|
||||
'a' => 'unplugChip',
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'session_id' => myself()->_getSessionId(),
|
||||
'account' => myself()->_getOpenId(),
|
||||
'type' => $type,
|
||||
'token_id' => $tokenId,
|
||||
'chip_ids' => implode('|', $chipIds)
|
||||
),
|
||||
array(
|
||||
'action' => Transaction::UNPLUG_CHIP_ACTION_TYPE,
|
||||
'tokenId' => $tokenId,
|
||||
'tokenType' => Nft::EQUIP_TYPE,
|
||||
'itemUniId' => $gunDb['chip_uniid'],
|
||||
'itemId' => $gunDb['item_id']
|
||||
)
|
||||
);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user