From ec9e27d3017dc4159b72a5701b89433a96c667b6 Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:51:42 +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=9A=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=20?= =?UTF-8?q?=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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/FlyCube/Api/Controller/CheckController.class.php b/FlyCube/Api/Controller/CheckController.class.php index ed75681..edb4782 100644 --- a/FlyCube/Api/Controller/CheckController.class.php +++ b/FlyCube/Api/Controller/CheckController.class.php @@ -187,10 +187,12 @@ class CheckController extends PublicController $where['openid'] = $this->openid; $order = $orderDb->where($where)->find(); - // // 获取 apply_price 并强制转换为浮动类型,保留两位小数 - // $applyPrice = round(floatval($_REQUEST['apply_price']), 2); - // // 获取订单的 total_price 并强制转换为浮动类型,保留两位小数 - // $totalPrice = round(floatval($order['total_price']), 2); + 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 并强制转换为浮动类型,保留两位小数 + $totalPrice = round(floatval($order['total_price']), 2); // 比较时确保两者都是浮动类型并且格式一致 if ($applyPrice > $totalPrice) { echo json_encode(array('status' => 0, 'msg' => '申请退款金额不能超过订单总额'));