This commit is contained in:
hujiabin 2023-08-28 11:54:48 +08:00
parent 668fd3fff5
commit 4f8ea3ac90
5 changed files with 21 additions and 19 deletions

View File

@ -56,6 +56,7 @@ class NftInfo(object):
['item_id', 0, 'item_id'],
['token_id', 0, 'token_id'],
['token_type', 0, 'token_type'],
['contract_address', 0, '合约地址'],
['createtime', 0, 'createtime'],
['!details', [], '详细'],
]

View File

@ -21,6 +21,7 @@ class NftController extends BaseAuthedController
"item_id" => $nft['item_id'],
"token_id" => $nft['token_id'],
"token_type" => $nft['token_type'],
"contract_address" => $nft['contract_address'],
"createtime" => $nft['createtime'],
"details" => array(),
);

View File

@ -186,12 +186,12 @@ class Chip extends BaseModel
'rand_attr'=> $rand_attr,
);
$dto['chip_name'] = mt\Item::get($row['item_id'])?mt\Item::get($row['item_id'])['name']:'XXX';
$nft_address = '';
$contract = ContractConfig::find(ContractConfig::ERC721);
if ($dto['token_id']){
$nft_address = $contract ? $contract['chip'] : "";
}
$dto['nft_address'] = $nft_address;
// $nft_address = '';
// $contract = ContractConfig::find(ContractConfig::ERC721);
// if ($dto['token_id']){
// $nft_address = $contract ? $contract['chip'] : "";
// }
// $dto['nft_address'] = $nft_address;
$dto['tags'] = '';
return $dto;
}

View File

@ -286,13 +286,13 @@ class Gun extends BaseModel {
);
$nft_address = '';
$contract = ContractConfig::find(ContractConfig::ERC721);
if ($row['token_id']){
$nft_address = $contract ? $contract['gun'] : "";
}
$dto['nft_address'] = $nft_address;
// $nft_address = '';
// $contract = ContractConfig::find(ContractConfig::ERC721);
// if ($row['token_id']){
// $nft_address = $contract ? $contract['gun'] : "";
// }
//
// $dto['nft_address'] = $nft_address;
return $dto;
}

View File

@ -304,12 +304,12 @@ class Hero extends BaseModel {
);
$nft_address = '';
$contract = ContractConfig::find(ContractConfig::ERC721);
if ($row['token_id']){
$nft_address = $contract ? $contract['hero'] : "";
}
$dto['nft_address'] = $nft_address;
// $nft_address = '';
// $contract = ContractConfig::find(ContractConfig::ERC721);
// if ($row['token_id']){
// $nft_address = $contract ? $contract['hero'] : "";
// }
// $dto['nft_address'] = $nft_address;
return $dto;
}