From acbfa7d61e1deaf216b47d10d52b0455de793d87 Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 3 Jan 2023 16:39:31 +0800 Subject: [PATCH] ... --- doc/Market.py | 2 ++ webapp/controller/MarketController.class.php | 24 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/doc/Market.py b/doc/Market.py index 1f6589e7..041bef12 100644 --- a/doc/Market.py +++ b/doc/Market.py @@ -17,6 +17,8 @@ class NftIntro(object): ['c_job', 0, '缓存-职业'], ['c_lv', 0, '缓存-级别'], ['c_id', 0, '缓存-idx'], + ['selling', 0, '正在售卖的个数'], + ['o_link', '', '关联的售卖单号'], ['details', _common.NftDetail(), 'nft列表'], ] diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 454e67ee..a1a2d927 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -868,6 +868,7 @@ class MarketController extends BaseController { $nfts = array(); for ($x = $start; $x < $page_end; $x++) { $row = $rows[$x]; + $this->attach_market_selling($row); array_push($nfts, $row); } @@ -1007,4 +1008,27 @@ class MarketController extends BaseController { } return $detail; } + + private function attach_market_selling(&$row) { + $conn = myself()->_getMysql(''); + + $rows = $conn->execQuery( + 'SELECT * FROM t_market_store '. + 'WHERE token_id=:token_id AND owner_address=:owner_address', + array( + ':token_id' => $row['token_id'], + ':owner_address' => $row['owner_address'], + ) + ); + + $count = 0; + $link_array = array(); + foreach ($rows as $r) { + $count += $r['amount']; + array_push($link_array, $r['idx']); + } + + $row['o_link'] = implode('|', $link_array); + $row['selling'] = $count; + } }