diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 4c4c667d..a6c7da50 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -542,7 +542,7 @@ class MarketController extends BaseController { myself()->_rspOk(); } - private function getNftListByAccountAndType($account, $type, $order_method, $order_asc) + private function getNftListByAccountAndType($account, $type, $order_method, $order_asc, $job, $search, $lv) { $sortByLevel = function ($a, $b) use ($order_asc) { return ($order_asc == 1 ? 1 : -1) * ($b['detail']['hero_lv'] - $a['detail']['hero_lv']); @@ -576,16 +576,17 @@ class MarketController extends BaseController { $nftDb = Nft::getNft($row['token_id']); $row['info'] = Nft::toDto($nftDb); $row['detail'] = Hero::toDtoInfo(Hero::findByTokenId2($row['token_id'])); + array_push($nfts, $row); } switch ($order_method) { case 1: - usort($rows, $sortByLevel); + usort($nfts, $sortByLevel); break; case 2: - usort($rows, $sortByTili); + usort($nfts, $sortByTili); break; case 3: - usort($rows, $sortByStar); + usort($nfts, $sortByStar); break; } } @@ -596,6 +597,7 @@ class MarketController extends BaseController { $nftDb = Nft::getNft($row['token_id']); $row['info'] = Nft::toDto($nftDb); $row['detail'] = Gun::toDtoInfo(Gun::findByTokenId2($row['token_id'])); + array_push($nfts, $row); } switch ($order_method) { case 1: @@ -614,6 +616,7 @@ class MarketController extends BaseController { $rows = Nft::getNft1155List($account, $type); foreach ($rows as &$row) { $row['detail'] = Chip::toDto(Chip::getChipByTokenId($row['token_id'])); + array_push($nfts, $row); } switch ($order_method) { case 1: @@ -628,13 +631,14 @@ class MarketController extends BaseController { case 4: { $rows = Nft::getNft1155List($account, $type); usort($rows, $sortByTokenId); + $nfts = $rows; } break; default: { - $rows = array(); + } } - return $rows; + return $nfts; } public function listSellNfts() @@ -726,7 +730,7 @@ class MarketController extends BaseController { $lv_filter = getReqVal('lv_filter', 15); $account = '0x9a4d9dd2bfcad659975f0f5a480625c7929e9385'; - $rows = $this->getNftListByAccountAndType($account, $type, $order_method, $order_asc); + $rows = $this->getNftListByAccountAndType($account, $type, $order_method, $order_asc, $job_filter_array, $search_filter_array, $lv_filter); $total = count($rows); $page_end = $start + $page_size;