From 70a23fb4dcc89b8ba1318b522433b25ba48b5905 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 27 Jun 2024 11:00:44 +0800 Subject: [PATCH] 1 --- .../controller/OutAppNftController.class.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index e3ab0376..b876dadd 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -159,6 +159,9 @@ class OutAppNftController extends BaseController { "value" => intval($heroDb['hero_lv']), "max_value" => 15, )); + if ($this->isCloseBox()) { + $this->fillBoxMeta($info); + } } break; case Nft::GOLD_BULLION_TYPE: @@ -167,6 +170,9 @@ class OutAppNftController extends BaseController { //$info['name'] = $heroMeta['name']; $info['description'] = $NftMeta['desc']; $info['image'] = "https://res2.counterfire.games/nft/meta/".$nftDb['item_id'].".png"; + if ($this->isCloseBox()) { + $this->fillBoxMeta($info); + } } break; } @@ -280,6 +286,9 @@ class OutAppNftController extends BaseController { $info['detail']['crit'] = $heroAbility['critical']; } } + if ($this->isCloseBox()) { + $this->fillBoxDetail($info); + } } break; case Nft::GOLD_BULLION_TYPE: @@ -293,6 +302,9 @@ class OutAppNftController extends BaseController { $info['image'] = 'https://res2.counterfire.games/nft/meta/' . $itemMeta['id'] . '.png'; $info['detail']['gold_coins'] = $this->getGoldBullionGoldNum($nftDb['item_id']); } + if ($this->isCloseBox()) { + $this->fillBoxDetail($info); + } } break; } @@ -318,4 +330,39 @@ class OutAppNftController extends BaseController { } } + private function isCloseBox() + { + $openTime = 1719828000; + if (myself()->_getNowTime() < $openTime) { + if (SERVER_ENV == _ONLINE) { + return true; + } + } + return false; + } + + private function fillBoxMeta(&$info) + { + $info['name'] = 'box'; + $info['description'] = 'box'; + $info['image'] = "https://res2.counterfire.games/nft/box/Gen2_raw.gif"; + $info['attributes'] = array(); + } + + private function fillBoxDetail(&$info) + { + $info = array( + 'net_id' => $info['net_id'], + 'contract_address' => $info['contract_address'], + 'token_id' => $info['token_id'], + 'owner_address' => $info['owner_address'], + 'meta_url' => $info['meta_url'], + 'name' => 'box', + 'item_id' => 0, + 'type' => $info['type'], + 'image' => "https://res2.counterfire.games/nft/box/Gen2_raw.gif", + 'detail' => array() + ); + } + }