This commit is contained in:
aozhiwei 2022-04-24 15:44:10 +08:00
parent abef3067b0
commit 80ca38f784
2 changed files with 8 additions and 1 deletions

View File

@ -527,6 +527,7 @@ class NftDetail(object):
['type', '', 'nft类型 1:英雄 2:枪支 3:芯片 4:盲盒'], ['type', '', 'nft类型 1:英雄 2:枪支 3:芯片 4:盲盒'],
['image', '', 'nft图片地址'], ['image', '', 'nft图片地址'],
['state', 0, '0:正常状态 1:出售中 2:出租中'], ['state', 0, '0:正常状态 1:出售中 2:出租中'],
['lock_time', 0, '锁定时间(单位秒)'],
['hide_attr', 0, '是否隐藏属性'], ['hide_attr', 0, '是否隐藏属性'],
['is_genesis', 0, '是否创世nft'], ['is_genesis', 0, '是否创世nft'],
['info', Union([ ['info', Union([

View File

@ -106,11 +106,14 @@ class Nft extends BaseModel {
} }
$tags = self::parseTags($nftDb['tags']); $tags = self::parseTags($nftDb['tags']);
$image = 'https://www.cebg.games/res/avatars/' . $itemMeta['id'] . '.png'; $image = 'https://www.cebg.games/res/avatars/' . $itemMeta['id'] . '.png';
$full_image = 'https://www.cebg.games/res/avatars/full_' . $itemMeta['id'] . '.png';
if (in_array(self::GENESIS_TAG, $tags)) { if (in_array(self::GENESIS_TAG, $tags)) {
$image = 'https://www.cebg.games/res/avatars/' . $itemMeta['id'] . '_1' . '.png'; $image = 'https://www.cebg.games/res/avatars/' . $itemMeta['id'] . '_1' . '.png';
$full_image = 'https://www.cebg.games/res/avatars/full_' . $itemMeta['id'] . '_1' . '.png';
} }
if ($nftDb['token_type'] == self::CHIP_TYPE) { if ($nftDb['token_type'] == self::CHIP_TYPE) {
$image = 'https://www.cebg.games/res/avatars/' . $itemMeta['id'] . '_a' . '.png'; $image = 'https://www.cebg.games/res/avatars/' . $itemMeta['id'] . '_a' . '.png';
$full_image = 'https://www.cebg.games/res/avatars/full_' . $itemMeta['id'] . '_a' . '.png';
} }
$nft = array( $nft = array(
'token_id' => $nftDb['token_id'], 'token_id' => $nftDb['token_id'],
@ -119,9 +122,11 @@ class Nft extends BaseModel {
'item_id' => $nftDb['item_id'], 'item_id' => $nftDb['item_id'],
'type' => $nftDb['token_type'], 'type' => $nftDb['token_type'],
'state' => $nftDb['token_state'], 'state' => $nftDb['token_state'],
'lock_time' => 0,
'hide_attr' => 0, 'hide_attr' => 0,
'is_genesis' => in_array(self::GENESIS_TAG, $tags), 'is_genesis' => in_array(self::GENESIS_TAG, $tags),
'image' => $image, 'image' => $image,
'full_image' => $full_image,
'currency_list' => array(), 'currency_list' => array(),
'transaction_recrod' => array(), 'transaction_recrod' => array(),
'info' => array( 'info' => array(
@ -156,6 +161,7 @@ class Nft extends BaseModel {
'equpMeta' => $equipMeta, 'equpMeta' => $equipMeta,
'nftDb' => $nftDb 'nftDb' => $nftDb
))); )));
$nft['full_image'] = $nft['image'];
$nft['info']['level'] = 1; $nft['info']['level'] = 1;
$nft['info']['quality'] = 1; $nft['info']['quality'] = 1;
$nft['info']['lucky'] = $equipMeta ? $equipMeta['gun_lucky'] : 0; $nft['info']['lucky'] = $equipMeta ? $equipMeta['gun_lucky'] : 0;
@ -199,7 +205,7 @@ class Nft extends BaseModel {
break; break;
case Nft::CHIP_TYPE: case Nft::CHIP_TYPE:
{ {
$nft['hide_attr'] = 1;
} }
break; break;
default: default: