...
This commit is contained in:
parent
bc7353bd1c
commit
5ee9fd8d66
@ -345,6 +345,8 @@ class Market(object):
|
|||||||
['job_filters', '', '职业过滤(用|分割)'],
|
['job_filters', '', '职业过滤(用|分割)'],
|
||||||
['search_filters', '', '搜索过滤(用|分割)'],
|
['search_filters', '', '搜索过滤(用|分割)'],
|
||||||
['lv_filter', 0, '等级过滤'],
|
['lv_filter', 0, '等级过滤'],
|
||||||
|
['quality_filter', 0, '品阶顾虑'],
|
||||||
|
['durability_filter', 0, '能量过滤'],
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
@ -541,7 +541,7 @@ class MarketController extends BaseController {
|
|||||||
myself()->_rspOk();
|
myself()->_rspOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getNftListByAccountAndType($account, $type, $order_method, $order_asc, $job, $search, $lv)
|
private function getNftListByAccountAndType($account, $type, $order_method, $order_asc, $job, $search, $lv, $quality, $durability)
|
||||||
{
|
{
|
||||||
$sortByLevel = function ($a, $b) use ($order_asc) {
|
$sortByLevel = function ($a, $b) use ($order_asc) {
|
||||||
return ($order_asc == 1 ? 1 : -1) * ($b['detail']['hero_lv'] - $a['detail']['hero_lv']);
|
return ($order_asc == 1 ? 1 : -1) * ($b['detail']['hero_lv'] - $a['detail']['hero_lv']);
|
||||||
@ -577,6 +577,8 @@ class MarketController extends BaseController {
|
|||||||
$row['detail'] = Hero::toDtoInfo(Hero::findByTokenId2($row['token_id']));
|
$row['detail'] = Hero::toDtoInfo(Hero::findByTokenId2($row['token_id']));
|
||||||
if (in_array($row['info']['info']['job'], $job)==false) continue;
|
if (in_array($row['info']['info']['job'], $job)==false) continue;
|
||||||
if ($row['detail']['hero_lv']<$lv) 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) {
|
if (count($search)>0) {
|
||||||
$searchLower = array_map('strtolower', $search);
|
$searchLower = array_map('strtolower', $search);
|
||||||
if (!(in_array(strtolower($row['detail']['hero_name']), $searchLower) || in_array(strtolower($row['detail']['token_id']), $searchLower))) continue;
|
if (!(in_array(strtolower($row['detail']['hero_name']), $searchLower) || in_array(strtolower($row['detail']['token_id']), $searchLower))) continue;
|
||||||
@ -603,8 +605,11 @@ class MarketController extends BaseController {
|
|||||||
$row['info'] = Nft::toDto($nftDb);
|
$row['info'] = Nft::toDto($nftDb);
|
||||||
$row['detail'] = Gun::toDtoInfo(Gun::findByTokenId2($row['token_id']));
|
$row['detail'] = Gun::toDtoInfo(Gun::findByTokenId2($row['token_id']));
|
||||||
if ($row['detail']['gun_lv']<$lv) continue;
|
if ($row['detail']['gun_lv']<$lv) continue;
|
||||||
|
if ($row['detail']['quality']<$quality) continue;
|
||||||
|
if ($row['detail']['durability']<$durability) continue;
|
||||||
if (count($search)>0) {
|
if (count($search)>0) {
|
||||||
if (!(in_array($row['detail']['gun_name'], $search) || in_array($row['detail']['token_id'], $search))) continue;
|
$searchLower = array_map('strtolower', $search);
|
||||||
|
if (!(in_array(strtolower($row['detail']['gun_name']), $searchLower) || in_array(strtolower($row['detail']['token_id']), $searchLower))) continue;
|
||||||
}
|
}
|
||||||
array_push($nfts, $row);
|
array_push($nfts, $row);
|
||||||
}
|
}
|
||||||
@ -802,9 +807,11 @@ class MarketController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$lv_filter = getReqVal('lv_filter', 15);
|
$lv_filter = getReqVal('lv_filter', 15);
|
||||||
|
$quality_filter = getReqVal('quality_filter', 15);
|
||||||
|
$durability_filter = getReqVal('durability_filter', 15);
|
||||||
$account = '0x9a4d9dd2bfcad659975f0f5a480625c7929e9385';
|
$account = '0x9a4d9dd2bfcad659975f0f5a480625c7929e9385';
|
||||||
|
|
||||||
$rows = $this->getNftListByAccountAndType($account, $type, $order_method, $order_asc, $job_filter_array, $search_filter_array, $lv_filter);
|
$rows = $this->getNftListByAccountAndType($account, $type, $order_method, $order_asc, $job_filter_array, $search_filter_array, $lv_filter, $quality_filter, $durability_filter);
|
||||||
|
|
||||||
$total = count($rows);
|
$total = count($rows);
|
||||||
$page_end = $start + $page_size;
|
$page_end = $start + $page_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user