Merge branch 'star' of git.kingsome.cn:server/game2006api into star
This commit is contained in:
commit
1a615a971d
@ -900,6 +900,48 @@ class MarketController extends BaseController {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sell() {
|
||||||
|
$account = strtolower(getReqVal('account', ''));
|
||||||
|
$item_id = getReqVal('item_id', '');
|
||||||
|
$token = getReqVal('token', '');
|
||||||
|
$nft_token = getReqVal('nft_token', '');
|
||||||
|
$s_price = getReqVal('s_price', '');
|
||||||
|
$amount = getReqVal('amount', 1);
|
||||||
|
$payment_token_address = getReqVal('payment_token_address', '');
|
||||||
|
$nonce = getReqVal('nonce', '');
|
||||||
|
$signature = getReqVal('signature', '');
|
||||||
|
$net_id = getReqVal('net_id', '');
|
||||||
|
|
||||||
|
$conn = myself()->_getMysql('');
|
||||||
|
|
||||||
|
$nftDb = Nft::findNftByOwner($account, $nft_token);
|
||||||
|
$nftDetail = Nft::toDto($nftDb);
|
||||||
|
$detail = $this->getNftGameData($nftDb);
|
||||||
|
$r = SqlHelper::insert(
|
||||||
|
$conn,
|
||||||
|
't_market_store',
|
||||||
|
array(
|
||||||
|
'token_id' => $nft_token,
|
||||||
|
'token_type' => $nftDetail['type'],
|
||||||
|
'owner' => $account,
|
||||||
|
'price' => $s_price,
|
||||||
|
'amount' => $amount,
|
||||||
|
'payment_token_address' => $payment_token_address,
|
||||||
|
'status' => 0,
|
||||||
|
'create_time' => time(),
|
||||||
|
'update_time' => time(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (!$r) {
|
||||||
|
myself()->_rspErr(1, 'insert error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$this->_rspData(array(
|
||||||
|
'nft' => $nftDetail,
|
||||||
|
'detail' => $detail,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
public function sellMyNft() {
|
public function sellMyNft() {
|
||||||
|
|
||||||
$account = strtolower(getReqVal('account', ''));
|
$account = strtolower(getReqVal('account', ''));
|
||||||
|
@ -1377,7 +1377,8 @@ class ShopController extends BaseAuthedController
|
|||||||
if (!empty($goods['free_type'])) {
|
if (!empty($goods['free_type'])) {
|
||||||
$count = $this->countFreeBuyTimes($goods['free_type'], $goods['id'], $goods['goods_id']);
|
$count = $this->countFreeBuyTimes($goods['free_type'], $goods['id'], $goods['goods_id']);
|
||||||
$goods['free_num'] = $goods['free_num'] - $count;
|
$goods['free_num'] = $goods['free_num'] - $count;
|
||||||
error_log('free_num:' . $goods['free_num']);
|
} else {
|
||||||
|
$goods['free_num'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$free_num = $goods['free_num'];
|
$free_num = $goods['free_num'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user