diff --git a/doc/Mall.py b/doc/Mall.py index 63724f6f..c6124715 100644 --- a/doc/Mall.py +++ b/doc/Mall.py @@ -14,6 +14,7 @@ class Mall(object): 'params': [ _common.ReqHead(), ['page', 0, '第几页数据'], + ['seller', '', '查询指定钱包 为空的化查询所有人'], ], 'response': [ _common.RspHead(), diff --git a/doc/Market.py b/doc/Market.py index bfc4ca85..46d16351 100644 --- a/doc/Market.py +++ b/doc/Market.py @@ -22,35 +22,13 @@ class Market(object): ['quality_filter', 0, '品阶顾虑'], ['durability_filter', 0, '能量过滤'], ['price_filter', '', '价格过滤(用|分割)'], - ['amount_filter', '', '数量过滤(低|高)'] + ['amount_filter', '', '数量过滤(低|高)'], + ['seller', '', '出售方钱包地址'], ], 'response': [ _common.RspHead(), ['pagination', _common.Pagination(), '分页信息'], ['!rows', [_common.MarketGoods()], '商品列表'], ] - }, - { - 'name': 'listMyNfts', - 'desc': '获取自己的NFTs', - 'group': 'Market', - 'url': 'webapp/index.php?c=Market&a=listMyNfts', - 'params': [ - ['start', 0, '分页开始偏移'], - ['page_size', 0, '分页大小'], - ['order_method', 0, '排序方式 0:默认排序(当前指向1) 1:等级 2:能量值 3:星级 4:tokenid'], - ['order_asc', 0, '排序方向, 0:从小到大 1:从大到小'], - ['type', 0, '物品类型 1:英雄 2:武器 3:芯片 5:碎片'], - ['job_filters', '', '职业过滤(用|分割)'], - ['search_filters', '', '搜索过滤(用|分割)'], - ['lv_filter', 0, '等级过滤'], - ['quality_filter', 0, '品阶顾虑'], - ['durability_filter', 0, '能量过滤'], - ], - 'response': [ - _common.RspHead(), - _common.Pagination(), - ['!rows', [_common.MarketGoods()], 'nft列表'], - ] - }, + } ] diff --git a/webapp/controller/MallController.class.php b/webapp/controller/MallController.class.php index bf002bae..0fde6f9c 100644 --- a/webapp/controller/MallController.class.php +++ b/webapp/controller/MallController.class.php @@ -24,7 +24,11 @@ class MallController extends BaseAuthedController { public function productList() { $page = getReqVal('page', 0); + $seller = getReqVal('seller', ''); $queryData = array(); + if (!empty($seller)) { + $queryData['seller'] = $seller; + } $out = array( 'pagination' => array(), @@ -42,6 +46,12 @@ class MallController extends BaseAuthedController { 'filter' => array( 'data' => $queryData, 'fields' => array( + array( + 'name' => 'seller', + 'field_name' => 'seller_address', + 'cond' => '=', + 'ignore_empty' => true, + ), ) ), //'orderBy' => $orderBy, diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index bfdd82cb..fb604799 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -126,77 +126,6 @@ class MarketController extends BaseAuthedController { myself()->_rspData($out); } - public function listMyNfts() - { - $address = $this->_getAddress(); - if (empty($address)) { - myself()->_rspData(array( - 'total' => 0, - 'start' => 0, - 'page_size' => 0, - 'nfts' => array() - )); - return; - } - $start = getReqVal('start', 0); - $pageSize = getReqVal('page_size', 10); - $orderMethod = getReqVal('order_method', 0); - $orderAsc = getReqVal('order_asc', 1); - $type = getReqVal('type', 1); - $jobFilters = getReqVal('job_filters', ''); - - if (empty($jobFilters)) { - $jobFilterArray = array(); - } else { - $jobFilterArray = explode('|', $jobFilters); - } - - $searchFilters = getReqVal('search_filters', ''); - if ($searchFilters != '') { - $searchFilterArray = explode('|', $searchFilters); - } else { - $searchFilterArray = array(); - } - - $lvFilter = getReqVal('lv_filter', 0); - $qualityFilter = getReqVal('quality_filter', 0); - $durabilityFilter = getReqVal('durability_filter', 0); - - $rows = $this->getNftListByAccountAndType( - $account, - $type, - $orderMethod, - $orderAsc, - $jobFilterArray, - $searchFilterArray, - $lvFilter, - $qualityFilter, - $durabilityFilter); - - $total = count($rows); - $pageEnd = $start + $pageSize; - if ($pageEnd > $total) { - $pageEnd = $total; - $start = $total - 1; - $start = intval($start / $pageSize) * $pageSize; - if ($start < 0) $start = 0; - } - - $nfts = array(); - for ($x = $start; $x < $pageEnd; $x++) { - $row = $rows[$x]; - // $this->attach_market_selling($row); - array_push($nfts, $row); - } - - $this->_rspData(array( - "total" => $total, - "start" => $start, - "page_size" => $pageSize, - 'nfts' => $nfts, - )); - } - private function fillNftIntro($row) { $info = array( 'order_id' => $row['order_id'],