diff --git a/webapp/services/MarketService.php b/webapp/services/MarketService.php deleted file mode 100644 index a43afe45..00000000 --- a/webapp/services/MarketService.php +++ /dev/null @@ -1,215 +0,0 @@ -listMySelledNfts($account, $type)); - foreach ($rows as &$row) { - $nftDb = Nft::findNftByOwner($account, $row['token_id']); - if (empty($nftDb)) { - $nftDb = Nft::getNft($row['token_id']); - } - // $row['info'] = Nft::toDto($nftDb); - // $row['detail'] = Hero::toDtoInfo(Hero::findByTokenId2($row['token_id'])); - // if (in_array($row['info']['info']['job'], $job) == false) continue; - // if ($row['detail']['hero_lv'] < $lv) continue; - // if ($row['detail']['quality'] < $quality) continue; - // if ($row['detail']['hero_tili'] < $durability) continue; - if (count($search) > 0) { - $searchLower = array_map('strtolower', $search); - if (!(in_array(strtolower($row['detail']['hero_name']), $searchLower) || in_array(strtolower($row['detail']['token_id']), $searchLower))) continue; - } - // $row['detail'] = $this->appendChipsInfo($row['detail']); - array_push($nfts, $row); - } - switch ($order_method) { - case 1: - usort($nfts, $sortByLevel); - break; - case 2: - usort($nfts, $sortByTili); - break; - case 3: - usort($nfts, $sortByStar); - break; - } - } - break; - 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']); - if (empty($nftDb)) { - $nftDb = Nft::getNft($row['token_id']); - } - $row['info'] = Nft::toDto($nftDb); - $row['detail'] = Hero::toDtoInfo(Hero::findByTokenId2($row['token_id'])); - if (!empty($job)) { - if (in_array($row['info']['info']['job'], $job) == false) continue; - } - if ($row['detail']['hero_lv'] < $lv) continue; - if ($row['detail']['quality'] < $quality) continue; - if ($row['detail']['hero_tili'] < $durability) continue; - if (count($search) > 0) { - $searchLower = array_map('strtolower', $search); - if (!(in_array(strtolower($row['detail']['hero_name']), $searchLower) || in_array(strtolower($row['detail']['token_id']), $searchLower))) continue; - } - $row['detail'] = $this->appendChipsInfo($row['detail']); - array_push($nfts, $row); - } - switch ($order_method) { - case 1: - usort($nfts, $sortByLevel); - break; - case 2: - usort($nfts, $sortByTili); - break; - case 3: - usort($nfts, $sortByStar); - break; - } - } - 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']); - if (empty($nftDb)) { - $nftDb = Nft::getNft($row['token_id']); - } - $row['info'] = Nft::toDto($nftDb); - $row['detail'] = Gun::toDtoInfo(Gun::findByTokenId2($row['token_id'])); - if ($row['detail']['gun_lv'] < $lv) continue; - if ($row['detail']['quality'] < $quality) continue; - if ($row['detail']['durability'] < $durability) continue; - if (count($search) > 0) { - $searchLower = array_map('strtolower', $search); - if (!(in_array(strtolower($row['detail']['gun_name']), $searchLower) || in_array(strtolower($row['detail']['token_id']), $searchLower))) continue; - } - $row['detail'] = $this->appendChipsInfo($row['detail']); - array_push($nfts, $row); - } - switch ($order_method) { - case 1: - usort($nfts, $sortByGunLv); - break; - case 2: - usort($nfts, $sortByDurability); - break; - case 3: - usort($nfts, $sortByStar); - break; - } - } - 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)) - continue; - if ($row['detail']['chip_grade'] < $lv) continue; - if (count($search) > 0) { - $searchLower = array_map('strtolower', $search); - if (!(in_array(strtolower($row['detail']['chip_name']), $searchLower) || in_array(strtolower($row['detail']['token_id']), $searchLower))) continue; - } - array_push($nfts, $row); - } - switch ($order_method) { - case 1: - usort($nfts, $sortByGrade); - break; - case 2: - usort($nfts, $sortByPower); - break; - } - } - 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']); - if (empty($nftDb)) { - $nftDb = Nft::getNft($row['token_id']); - } - $row['detail'] = $this->getNftGameData($nftDb); - if (!in_array($row['detail']['type'], $job)) - continue; - if (count($search) > 0) { - $searchLower = array_map('strtolower', $search); - if (!(in_array(strtolower($row['detail']['name']), $searchLower) || in_array(strtolower($row['detail']['token_id']), $searchLower))) continue; - } - array_push($nfts, $row); - } - usort($nfts, $sortByTokenId); - } - break; - default: { - } - } - return $nfts; - } - -}