1
This commit is contained in:
parent
e782350d25
commit
1dd24ec83f
@ -20,6 +20,7 @@ use models\Nft;
|
||||
use models\BuyRecord;
|
||||
|
||||
const CURRENCY_DECIMALS = 8;
|
||||
const PRICE_PAD = '0000000000';
|
||||
|
||||
const PRESALE_NOT_STARTED = 0;
|
||||
const PRESALE_PREPARE = 1;
|
||||
@ -238,6 +239,9 @@ class MarketController extends BaseController {
|
||||
$originalPrice = $goodsMeta['price'] * pow(10, CURRENCY_DECIMALS);
|
||||
$discountPrice = $goodsMeta['discount'] * 100 > 0 ?
|
||||
$originalPrice * $goodsMeta['discount'] : $originalPrice;
|
||||
|
||||
$discountPrice .= PRICE_PAD;
|
||||
error_log('discountPrice:' . $discountPrice . ' price:' . $price . ' originPrice:' . $originalPrice);
|
||||
if (!$discountPrice || $price != $discountPrice) {
|
||||
myself()->_rspErr(500, 'price error');
|
||||
return;
|
||||
|
@ -50,15 +50,14 @@ class RestApiController extends BaseController {
|
||||
return;
|
||||
}
|
||||
$heroMeta = mt\Hero::get($nftDb['item_id']);
|
||||
$itemMeta = mt\Item::get($nftDb['item_id']) ;
|
||||
if (!$heroMeta || !$itemMeta) {
|
||||
if (!$heroMeta) {
|
||||
myself()->_rspErr(2, 'server internal error');
|
||||
return;
|
||||
}
|
||||
$nftDto = array();
|
||||
$nftDto['name'] = $heroMeta['name'];
|
||||
$nftDto['description'] = '';
|
||||
$nftDto['image'] = 'https://www.cebg.games/res/avatars/' . $itemMeta['nft_image_id'] . '.png';
|
||||
$nftDto['image'] = 'https://www.cebg.games/res/nft/' . $nftDb['item_id'] . '.png';
|
||||
|
||||
$nftDto['job'] = $heroMeta['herotype'];
|
||||
$nftDto['level'] = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user