From 487c74b4d6519c3b4c2da3ae4540fc674d02ba24 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 29 Jan 2022 15:46:11 +0800 Subject: [PATCH] 1 --- webapp/controller/MarketController.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index fbfb8ddf..f07ea799 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -98,7 +98,7 @@ class MarketController extends BaseController { } $originalPrice = $meta['price'] * pow(10, CURRENCY_DECIMALS); $discountPrice = $meta['discount'] * 100 > 0 ? - $originalPrice * $meta['discount'] : $meta['price']; + $originalPrice * $meta['discount'] : $originalPrice; $saleBox = array( 'box_id' => $boxId, 'item_id' => $meta['item_id'], @@ -178,6 +178,13 @@ class MarketController extends BaseController { myself()->_rspErr(500, 'not white list user'); return; } + $originalPrice = $goodsMeta['price'] * pow(10, CURRENCY_DECIMALS); + $discountPrice = $goodsMeta['discount'] * 100 > 0 ? + $originalPrice * $meta['discount'] : $originalPrice; + if (!$discountPrice || $price != $discountPrice) { + myself()->_rspErr(500, 'price error'); + return; + } $itemMeta = mt\Item::get($itemId); if (!$itemMeta || empty($itemMeta['nft_image_id']) ||