This commit is contained in:
songliang 2023-01-03 16:39:31 +08:00
parent 9db86d6d35
commit acbfa7d61e
2 changed files with 26 additions and 0 deletions

View File

@ -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列表'],
]

View File

@ -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;
}
}