This commit is contained in:
hujiabin 2022-11-10 16:51:25 +08:00
parent 9b9c1ae771
commit 21ae31f785
4 changed files with 199 additions and 8 deletions

View File

@ -41,8 +41,8 @@ class BlockChain(object):
], ],
'response': [ 'response': [
_common.RspHead(), _common.RspHead(),
['action', 0, '动作 1跳转英雄界面 '], ['action', 0,'动作 1特定英雄详情,2特定枪械详情,3:NFTs芯片列表,4:英雄进阶介面,5:枪械进阶介面,6:芯片升级介面,7:NFTs碎片列表 ,8:目标英雄详情介面的Chip页签,9:目标枪械详情介面的Chip页签 '],
['!params', [''], '参数列表'], ['!params', [''], '参数列表 params[0]: token_id'],
] ]
}, },
{ {

View File

@ -807,7 +807,7 @@ CREATE TABLE `t_transaction_prefee` (
`target_token_type` bigint NOT NULL DEFAULT '0' COMMENT 'target_token_type', `target_token_type` bigint NOT NULL DEFAULT '0' COMMENT 'target_token_type',
`item_uniid` bigint NOT NULL DEFAULT '0' COMMENT '道具uniid', `item_uniid` bigint NOT NULL DEFAULT '0' COMMENT '道具uniid',
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id', `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '道具数量', `item_num` double NOT NULL DEFAULT '0' COMMENT '道具数量',
`done` int(11) NOT NULL DEFAULT '0' COMMENT 'done', `done` int(11) NOT NULL DEFAULT '0' COMMENT 'done',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',

View File

@ -489,10 +489,13 @@ class BlockChainController extends BaseAuthedController {
0, 0,
$itemId $itemId
); );
$propertyChgService = new services\PropertyChgService();
$propertyChgService->addUserChg();
$decFeeCb($transId); $decFeeCb($transId);
myself()->_rspData(array( myself()->_rspData(array(
'trans_id' => $transId, 'trans_id' => $transId,
'params' => $rspObj['params'] 'params' => $rspObj['params'],
'property_chg' => $propertyChgService->toDto(),
)); ));
error_log(5555555555); error_log(5555555555);
} else { } else {
@ -621,10 +624,10 @@ class BlockChainController extends BaseAuthedController {
myself()->_rspErr(101, 'token_id paramater error'); myself()->_rspErr(101, 'token_id paramater error');
return; return;
} }
// //CEG扣除 //CEG扣除
// { {
// Chip::getChipByTokenId($chipIds); Chip::getChipByTokenId($chipIds[0]);
// } }
$this->internalBcCall( $this->internalBcCall(
array( array(
'c' => 'BcService', 'c' => 'BcService',
@ -687,6 +690,21 @@ class BlockChainController extends BaseAuthedController {
} }
} }
public function getJumpInfo(){
$transId = getReqVal('trans_id', '');
if (!$transId){
myself()->_rspErr(101, 'trans_id paramater error');
return;
}
$tranDb= Transaction::find($transId);
if (!$tranDb){
myself()->_rspErr(101, 'trans_id paramater error');
return;
}
$data = Transaction::getJumpInfo($tranDb);
myself()->_rspData($data);
}
private function internalActivate721Nft($tokenId, $tokenType, $itemUniId, $itemId) private function internalActivate721Nft($tokenId, $tokenType, $itemUniId, $itemId)
{ {
$params = array( $params = array(

View File

@ -112,6 +112,179 @@ class Transaction extends BaseModel {
} }
} }
public static function getJumpInfo($transDb)
{
$jumpInfo = null;
switch ($transDb['action']) {
case self::MINT_721_ACTION_TYPE:
{
switch ($transDb['token_type']) {
case Nft::HERO_TYPE:
{
$jumpInfo = array(
'action' => 1, //英雄激活(英雄详情)
'params' => array(
$transDb['token_id']
)
);
}
break;
case Nft::EQUIP_TYPE:
{
$jumpInfo = array(
'action' => 2,//武器激活(武器详情)
'params' => array(
$transDb['token_id']
)
);
}
break;
}
}
break;
case self::MINT_1155_ACTION_TYPE:
{
$jumpInfo = array(
'action' => 3, //芯片生成(芯片列表)
'params' => array(
$transDb['token_id']
)
);
}
break;
case self::EVOLVE_721_ACTION_TYPE:
{
switch ($transDb['token_type']) {
case Nft::HERO_TYPE:
{
$jumpInfo = array(
'action' => 4, //英雄升阶(英雄进阶界面)
'params' => array(
$transDb['token_id']
)
);
}
break;
case Nft::EQUIP_TYPE:
{
$jumpInfo = array(
'action' => 5,//武器升阶(武器进阶界面)
'params' => array(
$transDb['token_id']
)
);
}
break;
}
}
break;
case self::EVOLVE_CHIP_ACTION_TYPE:
{
$jumpInfo = array(
'action' => 6, //芯片进阶(芯片升级界面)
'params' => array(
$transDb['token_id']
)
);
}
break;
case self::MINT_SHARD_BATCH_ACTION_TYPE:
{
$jumpInfo = array(
'action' => 7, //碎片生成(碎片列表)
'params' => array(
$transDb['token_id']
)
);
}
break;
case self::SHARD_MIX_BY_USER_ACTION_TYPE:
{//碎片合成
switch ($transDb['token_type']) {
case Nft::HERO_TYPE:
{
$jumpInfo = array(
'action' => 1, //英雄合成(英雄详情)
'params' => array(
$transDb['token_id']
)
);
}
break;
case Nft::EQUIP_TYPE:
{
$jumpInfo = array(
'action' => 2,//武器合成(武器详情)
'params' => array(
$transDb['token_id']
)
);
}
break;
}
}
break;
case self::PLUGIN_CHIP_ACTION_TYPE:
{
switch ($transDb['token_type']) {
case Nft::HERO_TYPE:
{
$jumpInfo = array(
'action' => 8, //英雄芯片镶嵌目标英雄详情介面的Chip页签
'params' => array(
$transDb['token_id']
)
);
}
break;
case Nft::EQUIP_TYPE:
{
$jumpInfo = array(
'action' => 9,//武器芯片镶嵌目标枪械详情介面的Chip页签
'params' => array(
$transDb['token_id']
)
);
}
break;
}
}
break;
case self::UNPLUG_CHIP_ACTION_TYPE:
{
switch ($transDb['token_type']) {
case Nft::HERO_TYPE:
{
$jumpInfo = array(
'action' => 8, //英雄芯片卸下目标英雄详情介面的Chip页签
'params' => array(
$transDb['token_id']
)
);
}
break;
case Nft::EQUIP_TYPE:
{
$jumpInfo = array(
'action' => 9,//武器芯片卸下目标枪械详情介面的Chip页签
'params' => array(
$transDb['token_id']
)
);
}
break;
}
}
break;
default:
{
}
}
return $jumpInfo;
}
public static function getStatusDesc($transDb) public static function getStatusDesc($transDb)
{ {
switch ($transDb['status']) { switch ($transDb['status']) {