1
This commit is contained in:
parent
a14d1263e0
commit
f6768d6b90
@ -236,10 +236,16 @@ class OutAppNftController extends BaseController {
|
|||||||
$info['owner_address'] = $nftDb['owner_address'];
|
$info['owner_address'] = $nftDb['owner_address'];
|
||||||
$heroDb = Hero::findByTokenId2($tokenId);
|
$heroDb = Hero::findByTokenId2($tokenId);
|
||||||
if ($heroDb) {
|
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);
|
$heroAbility = Hero::abilityInfo($heroDb);
|
||||||
$heroMeta = \mt\Hero::get($heroDb['hero_id']);
|
$heroMeta = \mt\Hero::get($heroDb['hero_id']);
|
||||||
$heroAtteMeta = \mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$heroDb['quality']);
|
|
||||||
if ($heroMeta) {
|
if ($heroMeta) {
|
||||||
|
$heroAtteMeta = \mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$heroDb['quality']);
|
||||||
$info['meta_url'] = NFT_META_URL . '/hero/meta/' . $netId . '/' . $tokenId;
|
$info['meta_url'] = NFT_META_URL . '/hero/meta/' . $netId . '/' . $tokenId;
|
||||||
$info['name'] = $heroMeta['name'];
|
$info['name'] = $heroMeta['name'];
|
||||||
$info['item_id'] = $heroMeta['id'];
|
$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['image'] = 'https://www.cebg.games/res/avatars/' . $heroMeta['id'] . '.png';
|
||||||
$info['detail']['quality'] = $heroDb['quality'];
|
$info['detail']['quality'] = $heroDb['quality'];
|
||||||
$info['detail']['max_mining_days'] = $heroAtteMeta['validTime'];
|
$info['detail']['max_mining_days'] = $heroAtteMeta['validTime'];
|
||||||
$info['detail']['wealth'] = Hero::getHeroWealth($heroDb);
|
$info['detail']['wealth'] = floor($wealth * (1+$wealth_rate));
|
||||||
$info['detail']['lucky'] = Hero::getHeroLucky($heroDb);
|
$info['detail']['lucky'] = floor($lucky * (1+$lucky_rate));
|
||||||
$info['detail']['hp'] = $heroAbility['hp'];
|
$info['detail']['hp'] = $heroAbility['hp'];
|
||||||
$info['detail']['atk'] = $heroAbility['attack'];
|
$info['detail']['atk'] = $heroAbility['attack'];
|
||||||
$info['detail']['def'] = $heroAbility['defence'];
|
$info['detail']['def'] = $heroAbility['defence'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user