【类 型】:style
【原 因】: 【过 程】: 【影 响】:
This commit is contained in:
parent
5b9a92ff4c
commit
8c57077ac8
@ -190,12 +190,11 @@ class CheckController extends PublicController
|
||||
// 获取 apply_price 并强制转换为浮动类型,保留两位小数
|
||||
$applyPrice = round(floatval($_REQUEST['apply_price']), 2);
|
||||
// 获取订单的 price 并强制转换为浮动类型,保留两位小数
|
||||
$totalPrice = round(floatval($order['total_price']), 2);
|
||||
$transportPrice = round(floatval($order['transport_price']), 2);
|
||||
$packPrice = round(floatval($order['pack_price']), 2);
|
||||
$totalPrice = $totalPrice + $transportPrice + $packPrice; //价格总和
|
||||
$totalPrice = round(floatval($order['total_price']), 2); //商品价格
|
||||
$transportPrice = round(floatval($order['transport_price']), 2); //运费
|
||||
$packPrice = round(floatval($order['pack_price']), 2); //打包费
|
||||
// 比较时确保两者都是浮动类型并且格式一致
|
||||
if ($applyPrice > $totalPrice) {
|
||||
if ($applyPrice > ($totalPrice + $transportPrice + $packPrice)) {
|
||||
echo json_encode(array('status' => 0, 'msg' => '申请退款金额不能超过订单总额'));
|
||||
exit();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user