From 5b9a92ff4c4164d3d3f2846011a2a3e112b4a618 Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:56:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afix=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E8=AE=A2=E5=8D=95=E6=80=BB=E9=A2=9D=20=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E7=AD=89=E4=BA=8E=E5=95=86=E5=93=81=E6=80=BB=E4=BB=B7?= =?UTF-8?q?+=E6=89=93=E5=8C=85=E8=B4=B9+=E8=BF=90=E8=B4=B9=20=20=E5=90=8E?= =?UTF-8?q?=E9=9D=A2=E4=B8=A4=E4=B8=AA=E5=AD=97=E6=AE=B5=E6=B2=A1=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FlyCube/Api/Controller/CheckController.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FlyCube/Api/Controller/CheckController.class.php b/FlyCube/Api/Controller/CheckController.class.php index edb4782..7b335c6 100644 --- a/FlyCube/Api/Controller/CheckController.class.php +++ b/FlyCube/Api/Controller/CheckController.class.php @@ -187,12 +187,13 @@ class CheckController extends PublicController $where['openid'] = $this->openid; $order = $orderDb->where($where)->find(); - echo json_encode(array('status' => 0, 'msg' => [$_REQUEST['apply_price'], $order['total_price']])); - exit(); // 获取 apply_price 并强制转换为浮动类型,保留两位小数 $applyPrice = round(floatval($_REQUEST['apply_price']), 2); - // 获取订单的 total_price 并强制转换为浮动类型,保留两位小数 + // 获取订单的 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; //价格总和 // 比较时确保两者都是浮动类型并且格式一致 if ($applyPrice > $totalPrice) { echo json_encode(array('status' => 0, 'msg' => '申请退款金额不能超过订单总额'));