1
This commit is contained in:
parent
419e87b78d
commit
875b673371
@ -37,6 +37,19 @@ class MarketController extends BaseController {
|
||||
|
||||
public function prebuy()
|
||||
{
|
||||
$account = getReqVal('account', '');
|
||||
$goodsId = getReqVal('goods_id', '');
|
||||
|
||||
$goodsMeta = mt\Market::get($goodsId);
|
||||
if (!$goodsMeta) {
|
||||
$this->_rspErr(1, 'config error');
|
||||
return;
|
||||
}
|
||||
$inventory = Goods::getRemainBuyableNum($meta);
|
||||
if ($inventory < 0) {
|
||||
$this->_rspErr(2, 'insufficient inventory');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function sell()
|
||||
@ -88,7 +101,7 @@ class MarketController extends BaseController {
|
||||
$nft['type'] = 0;
|
||||
$nft['token_id'] = '';
|
||||
$nft['status'] = 0;
|
||||
$nft['inventory'] = 0;
|
||||
$nft['inventory'] = $inventory;
|
||||
$nft['owner_address'] = '';
|
||||
$nft['owner_id'] = '';
|
||||
$nft['image_avatar'] = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user