shop add discount

This commit is contained in:
songliang 2022-11-02 13:43:33 +08:00
parent 71cdfdf48a
commit 43ef81c3b1

View File

@ -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) {