...
This commit is contained in:
parent
9db86d6d35
commit
acbfa7d61e
@ -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列表'],
|
||||
]
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user