Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb

This commit is contained in:
hujiabin 2024-07-03 17:07:43 +08:00
commit 86f6343ffd

View File

@ -133,7 +133,11 @@ class OutAppNftController extends BaseController {
public function hasAnyNft() public function hasAnyNft()
{ {
$accountAddress = strtolower(getReqVal('account_address', '')); $accountAddress = strtolower(getReqVal('account_address', ''));
return services\NftService::hasAnyNft($accountAddress); $ret = services\NftService::hasAnyNft($accountAddress);
error_log('hasAnyNft:' . $accountAddress . ' ret:' . $ret);
$this->_rspData(array(
'has_any_nft' => $ret ? 1 : 0,
));
} }
public function nftMetaView() public function nftMetaView()
@ -173,20 +177,22 @@ class OutAppNftController extends BaseController {
$info['description'] = $NftMeta['desc']; $info['description'] = $NftMeta['desc'];
$info['image'] = "https://res2.counterfire.games/nft/meta/". $info['image'] = "https://res2.counterfire.games/nft/meta/".
$heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".gif"; $heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".gif";
$info['animation_url'] = "https://res.counterfire.games/nft/video/".
$heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".mp4";
array_push($info['attributes'],array( array_push($info['attributes'],array(
"trait_type" => "quality", "trait_type" => "Tier",
"value" => intval($this->getRealHeroQuality($heroDb)), "value" => intval($this->getRealHeroQuality($heroDb)),
)); ));
array_push($info['attributes'],array( array_push($info['attributes'],array(
"trait_type" => "max_mining_days", "trait_type" => "Active Days",
"value" => $heroAtteMeta['validTime'], "value" => $heroAtteMeta['validTime'],
)); ));
array_push($info['attributes'],array( array_push($info['attributes'],array(
"trait_type" => "wealth", "trait_type" => "Wealth Value",
"value" => floor($wealth * (1+$wealth_rate)), "value" => floor($wealth * (1+$wealth_rate)),
)); ));
array_push($info['attributes'],array( array_push($info['attributes'],array(
"trait_type" => "lucky", "trait_type" => "Luck Value",
"value" => floor($lucky * (1+$lucky_rate)), "value" => floor($lucky * (1+$lucky_rate)),
)); ));
if ($this->isCloseBox()) { if ($this->isCloseBox()) {