From 7e8b5a2276a7b8d2a6cd069dfae33e798c5d4fb5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 29 Jun 2024 15:44:33 +0800 Subject: [PATCH] 1 --- .../controller/OutAppNftController.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index 6935ace1..c8b4278d 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -233,6 +233,7 @@ class OutAppNftController extends BaseController { private function internalNftDetail($netId, &$nftDb, &$info) { + $onSale = $this->nftIsOnSale($nftDb['net_id'], $nftDb['contract_address'], $nftDb['token_id']); $info = array( 'net_id' => $netId, 'contract_address' => '', @@ -243,6 +244,7 @@ class OutAppNftController extends BaseController { 'item_id' => 0, 'type' => 0, 'image' => '', + 'on_sale' => $onSale, 'detail' => array() ); if (!empty($nftDb)) { @@ -361,8 +363,24 @@ class OutAppNftController extends BaseController { 'item_id' => 0, 'type' => $info['type'], 'image' => "https://res2.counterfire.games/nft/box/Gen2_raw.gif", + 'on_sale' => $info['on_sale'], 'detail' => array() ); } + private function nftIsOnSale($netId, $contractAddress, $tokenId) + { + $row = SqlHelper::ormSelectOne( + myself()->_getMarketMysql(), + 't_order', + array( + 'net_id' => $netId, + 'contract_address' => $contractAddress, + 'token_id' => $tokenId, + 'status' => 'ACTIVE', + ) + ); + return $row ? 1 : 0; + } + }