This commit is contained in:
hujiabin 2024-06-13 15:21:11 +08:00
parent a14d1263e0
commit f6768d6b90

View File

@ -236,10 +236,16 @@ class OutAppNftController extends BaseController {
$info['owner_address'] = $nftDb['owner_address'];
$heroDb = Hero::findByTokenId2($tokenId);
if ($heroDb) {
$heroAttrs = emptyReplace(json_decode($heroDb['wealth_attr'], true), array());
$heroResult = \mt\EconomyAttribute::getAttrValue($heroAttrs);
$wealth = $heroResult['wealth'];
$wealth_rate = $heroResult['wealth_rate'];
$lucky = $heroResult['lucky'];
$lucky_rate = $heroResult['lucky_rate'];
$heroAbility = Hero::abilityInfo($heroDb);
$heroMeta = \mt\Hero::get($heroDb['hero_id']);
$heroAtteMeta = \mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$heroDb['quality']);
if ($heroMeta) {
$heroAtteMeta = \mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$heroDb['quality']);
$info['meta_url'] = NFT_META_URL . '/hero/meta/' . $netId . '/' . $tokenId;
$info['name'] = $heroMeta['name'];
$info['item_id'] = $heroMeta['id'];
@ -247,8 +253,8 @@ class OutAppNftController extends BaseController {
$info['image'] = 'https://www.cebg.games/res/avatars/' . $heroMeta['id'] . '.png';
$info['detail']['quality'] = $heroDb['quality'];
$info['detail']['max_mining_days'] = $heroAtteMeta['validTime'];
$info['detail']['wealth'] = Hero::getHeroWealth($heroDb);
$info['detail']['lucky'] = Hero::getHeroLucky($heroDb);
$info['detail']['wealth'] = floor($wealth * (1+$wealth_rate));
$info['detail']['lucky'] = floor($lucky * (1+$lucky_rate));
$info['detail']['hp'] = $heroAbility['hp'];
$info['detail']['atk'] = $heroAbility['attack'];
$info['detail']['def'] = $heroAbility['defence'];