This commit is contained in:
songliang 2023-07-14 15:21:12 +08:00
parent a7a0a9b5ff
commit dd5d78003f
2 changed files with 14 additions and 2 deletions

View File

@ -711,7 +711,7 @@ class MarketController extends BaseAuthedController
'item_id' => $item_id,
'item_num' => $item_count,
'order_type' => 1,
'price' => $goods['s_price'],
'price' => $this->Web3PriceLowFormat($goods['s_price']),
'ext_data' => json_encode(array(
'mode' => MARKET_BUY_MODE_NORMAL,
'idx' => $idx,
@ -723,6 +723,12 @@ class MarketController extends BaseAuthedController
'block_chain' => $response,
));
}
private function Web3PriceLowFormat($price) {
$bn2 = phpcommon\bnInit('1000000000000000000');
$ret_price = phpcommon\bnDiv($price, $bn2);
return phpcommon\bnToStr($ret_price);
}
private function sellMyNft()
{

View File

@ -702,7 +702,7 @@ class ShopController extends BaseAuthedController
$costs = mt\Parameter::getByName('daily_selection_refresh_cost');
$arrCosts = explode('|', $costs['param_value']);
$maxCount = count($arrCosts);
$count = $this->countTodayRefreshTimes($address);
if ($count >= $maxCount) {
$this->_rspErr(2, 'The maximum number of refreshes has been reached');
@ -1993,6 +1993,12 @@ class ShopController extends BaseAuthedController
return phpcommon\bnToStr($ret_price);
}
private function Web3PriceLowFormat($price) {
$bn2 = phpcommon\bnInit('1000000000000000000');
$ret_price = phpcommon\bnDiv($price, $bn2);
return phpcommon\bnToStr($ret_price);
}
private function countFreeBuyTimes($free_type, $id, $goods_id)
{
$conn = myself()->_getMysql('');