diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index d680e9a3..529506d8 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -137,13 +137,18 @@ class ShopController extends BaseAuthedController { $price_array = splitStr1($row['price']); $discount_array = splitStr1($row['discount']); - $discount_begin = $row['discount_begin']; - $discount_end = $row['discount_end']; - $nowTime = $this->_getNowTime(); $need_price = $price_array[$token_pos]; $discount = $discount_array[$token_pos]; + $discount_begin = $row['discount_begin']; + $discount_end = $row['discount_end']; + $nowTime = $this->_getNowTime(); + + if ($nowTime>=$discount_begin && $nowTime<$discount_end) { + $need_price = ceil($need_price * ($discount / 100.0)); + } + $costItemId = $this->getCostItemIdByTokenType($token_type); switch($token_type) {