diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 529506d8..35cb0e13 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -141,11 +141,12 @@ class ShopController extends BaseAuthedController { $need_price = $price_array[$token_pos]; $discount = $discount_array[$token_pos]; - $discount_begin = $row['discount_begin']; - $discount_end = $row['discount_end']; + $discount_begin = strtotime($row['discount_begin'].' UTC'); + $discount_end = strtotime($row['discount_end'].' UTC'); $nowTime = $this->_getNowTime(); - + if ($nowTime>=$discount_begin && $nowTime<$discount_end) { + $need_price = ceil($need_price * ($discount / 100.0)); }