diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index db445dfe..2ca637c4 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -572,6 +572,7 @@ class MarketController extends BaseController { switch ($type) { case Nft::HERO_TYPE: { $rows = Nft::getNftListByType($account, $type); + $rows = array_merge($rows, $this->listMySelledNfts($account, $type)); foreach ($rows as &$row) { $nftDb = Nft::findNftByOwner($account, $row['token_id']); $row['info'] = Nft::toDto($nftDb); @@ -602,6 +603,7 @@ class MarketController extends BaseController { break; case Nft::EQUIP_TYPE: { $rows = Nft::getNftListByType($account, $type); + $rows = array_merge($rows, $this->listMySelledNfts($account, $type)); foreach ($rows as &$row) { $nftDb = Nft::findNftByOwner($account, $row['token_id']); $row['info'] = Nft::toDto($nftDb); @@ -631,6 +633,7 @@ class MarketController extends BaseController { break; case Nft::CHIP_TYPE: { $rows = Nft::getNft1155List($account, $type); + $rows = array_merge($rows, $this->listMySelledNfts($account, $type)); foreach ($rows as &$row) { $row['detail'] = Chip::toDto(Chip::getChipByTokenId($row['token_id'])); if (!in_array($row['detail']['chip_type'], $job)) @@ -654,6 +657,7 @@ class MarketController extends BaseController { break; case Nft::FRAGMENT_TYPE: { $rows = Nft::getNft1155List($account, $type); + $rows = array_merge($rows, $this->listMySelledNfts($account, $type)); foreach ($rows as &$row) { $nftDb = Nft::findNftByOwner($account, $row['token_id']); $row['detail'] = $this->getNftGameData($nftDb); @@ -868,7 +872,7 @@ class MarketController extends BaseController { $nfts = array(); for ($x = $start; $x < $page_end; $x++) { $row = $rows[$x]; - $this->attach_market_selling($row); + // $this->attach_market_selling($row); array_push($nfts, $row); } @@ -1241,4 +1245,20 @@ class MarketController extends BaseController { $row['o_link'] = implode('|', $link_array); $row['selling'] = $count; } + + private function listMySelledNfts($account, $type) + { + $conn = myself()->_getMysql(''); + + $rows = $conn->execQuery( + 'SELECT * FROM t_market_store '. + 'WHERE owner_address=:account AND token_type=:token_type AND status=0 ', + array( + ':account' => $account, + ':token_type' => $type, + ) + ); + + return $rows; + } }