This commit is contained in:
aozhiwei 2024-07-26 17:44:29 +08:00
commit ef48a801b5

View File

@ -181,11 +181,17 @@ class OutAppNftController extends BaseController {
$info['token_id'] = $tokenId; $info['token_id'] = $tokenId;
$info['name'] = $heroMeta['name']; $info['name'] = $heroMeta['name'];
$info['description'] = $NftMeta['desc']; $info['description'] = $NftMeta['desc'];
$info['image'] = "https://res2.counterfire.games/nft/meta/". if ($nftDb['token_type'] == Nft::GCARD_HERO_TYPE) {
$heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".gif"; $info['image'] = 'https://res2.counterfire.games/nft/video/normal/' . $heroMeta['id'] . '_c' . $this->getRealHeroQuality($heroDb) . '.mp4';
} else {
$info['image'] = 'https://res2.counterfire.games/nft/video/genesis/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.mp4';
}
if ($this->isWingHero($nftDb['token_id'])) {
$info['image'] = 'https://res2.counterfire.games/nft/video/wing/' . $heroMeta['id'] . '_w' . $this->getRealHeroQuality($heroDb) . '.mp4';
}
$info['animation_url'] = "https://res.counterfire.games/nft/video/". $info['animation_url'] = "https://res.counterfire.games/nft/video/".
$heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".mp4"; $heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".mp4";
if ($info['token_id'] > 6240603010001668 && $info['token_id'] <= 6240603010002168){ if ($this->isWingHero($nftDb['token_id'])) {
$info['animation_url'] = "https://res.counterfire.games/nft/video/wing/". $info['animation_url'] = "https://res.counterfire.games/nft/video/wing/".
$heroDb['hero_id'].'_w'.$this->getRealHeroQuality($heroDb).".mp4"; $heroDb['hero_id'].'_w'.$this->getRealHeroQuality($heroDb).".mp4";
} }
@ -330,11 +336,14 @@ class OutAppNftController extends BaseController {
$info['item_id'] = $heroMeta['id']; $info['item_id'] = $heroMeta['id'];
$info['type'] = $nftDb['token_type']; $info['type'] = $nftDb['token_type'];
//$info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.gif'; //$info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.gif';
if (($nftDb['token_type']) == Nft::GCARD_HERO_TYPE) { if ($nftDb['token_type'] == Nft::GCARD_HERO_TYPE) {
$info['image'] = 'https://res2.counterfire.games/nft/video/normal/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.mp4'; $info['image'] = 'https://res2.counterfire.games/nft/video/normal/' . $heroMeta['id'] . '_c' . $this->getRealHeroQuality($heroDb) . '.mp4';
} else { } else {
$info['image'] = 'https://res2.counterfire.games/nft/video/genesis/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.mp4'; $info['image'] = 'https://res2.counterfire.games/nft/video/genesis/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.mp4';
} }
if ($this->isWingHero($nftDb['token_id'])) {
$info['image'] = 'https://res2.counterfire.games/nft/video/wing/' . $heroMeta['id'] . '_w' . $this->getRealHeroQuality($heroDb) . '.mp4';
}
$info['detail']['quality'] = $this->getRealHeroQuality($heroDb); $info['detail']['quality'] = $this->getRealHeroQuality($heroDb);
$info['detail']['max_mining_days'] = $heroAtteMeta['validTime']; $info['detail']['max_mining_days'] = $heroAtteMeta['validTime'];
$info['detail']['wealth'] = floor($wealth * (1+$wealth_rate)); $info['detail']['wealth'] = floor($wealth * (1+$wealth_rate));
@ -530,7 +539,7 @@ class OutAppNftController extends BaseController {
$info['name'] = $heroMeta['name']; $info['name'] = $heroMeta['name'];
$info['item_id'] = $heroMeta['id']; $info['item_id'] = $heroMeta['id'];
$info['type'] = Nft::HERO_TYPE; $info['type'] = Nft::HERO_TYPE;
$info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.gif'; $info['image'] = 'https://res2.counterfire.games/nft/video/normal/' . $heroMeta['id'] . '_c' . $this->getRealHeroQuality($heroDb) . '.mp4';
$info['detail']['quality'] = $this->getRealHeroQuality($heroDb); $info['detail']['quality'] = $this->getRealHeroQuality($heroDb);
$info['detail']['max_mining_days'] = $heroAtteMeta['validTime']; $info['detail']['max_mining_days'] = $heroAtteMeta['validTime'];
$info['detail']['wealth'] = floor($wealth * (1+$wealth_rate)); $info['detail']['wealth'] = floor($wealth * (1+$wealth_rate));
@ -546,4 +555,8 @@ class OutAppNftController extends BaseController {
myself()->_rspData($rspData); myself()->_rspData($rspData);
} }
private function isWingHero($tokenId)
{
return $tokenId > 6240603010001668 && $tokenId <= 6240603010002168
}
} }