diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index fb10e7a3..045906c7 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -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; diff --git a/webapp/controller/RestApiController.class.php b/webapp/controller/RestApiController.class.php index 2a40c33a..c87319cd 100644 --- a/webapp/controller/RestApiController.class.php +++ b/webapp/controller/RestApiController.class.php @@ -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;