This commit is contained in:
aozhiwei 2024-07-02 19:29:48 +08:00
parent dd6e225bea
commit b49d90706b

View File

@ -150,16 +150,36 @@ class OutAppNftController extends BaseController {
echo json_encode($info);
die;
}
$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']);
$NftMeta = \mt\NftDesc::getByItemId($heroDb['hero_id']);
$itemMeta = \mt\Item::get($heroDb['hero_id']);
$heroAtteMeta = \mt\EconomyAttribute::findByGrade($itemMeta['relationship'],$heroDb['quality']);
$info['token_id'] = $tokenId;
$info['name'] = $heroMeta['name'];
$info['description'] = $NftMeta['desc'];
$info['image'] = "https://res2.counterfire.games/nft/meta/".$heroDb['hero_id'].'_'.$heroDb['quality'].".gif";
array_push($info['attributes'],array(
"trait_type" => "level",
"value" => intval($heroDb['hero_lv']),
"max_value" => 15,
"trait_type" => "quality",
"value" => intval($heroDb['quality']),
));
array_push($info['attributes'],array(
"trait_type" => "max_mining_days",
"value" => $heroAtteMeta['validTime'],
));
array_push($info['attributes'],array(
"trait_type" => "wealth",
"value" => floor($wealth * (1+$wealth_rate)),
));
array_push($info['attributes'],array(
"trait_type" => "lucky",
"value" => floor($lucky * (1+$lucky_rate)),
));
if ($this->isCloseBox()) {
$this->fillBoxMeta($info);