diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index a7a329c5..29756913 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -235,7 +235,9 @@ class OutAppNftController extends BaseController { $info['owner_address'] = $nftDb['owner_address']; $heroDb = Hero::findByTokenId2($tokenId); if ($heroDb) { + $heroAbility = Hero::abilityInfo($heroDb); $heroMeta = \mt\Hero::get($heroDb['hero_id']); + $heroAtteMeta = \mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$heroDb['quality']); if ($heroMeta) { $info['meta_url'] = NFT_META_URL . '/hero/meta/' . $netId . '/' . $tokenId; $info['name'] = $heroMeta['name']; @@ -243,6 +245,14 @@ class OutAppNftController extends BaseController { $info['type'] = $nftDb['token_type']; $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']['hp'] = $heroAbility['hp']; + $info['detail']['atk'] = $heroAbility['attack']; + $info['detail']['def'] = $heroAbility['defence']; + $info['detail']['block'] = $heroAbility['block']; + $info['detail']['crit'] = $heroAbility['critical']; } } } diff --git a/webapp/models/Hero.php b/webapp/models/Hero.php index 4229cc58..1e72df62 100644 --- a/webapp/models/Hero.php +++ b/webapp/models/Hero.php @@ -422,7 +422,7 @@ class Hero extends BaseModel { return $avatarInfos; } - private static function abilityInfo($row ){ + public static function abilityInfo($row ){ $info = array( 'hp' => 0, 'attack' => 0,