From 10d90e9fb2cf464d4ab84882fe03ecdd07cd5d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 9 Oct 2024 21:33:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=89=A9=E4=BD=99=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-plugs-payment/src/service/Payment.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/think-plugs-payment/src/service/Payment.php b/plugin/think-plugs-payment/src/service/Payment.php index fb1c2c338..6548e515a 100644 --- a/plugin/think-plugs-payment/src/service/Payment.php +++ b/plugin/think-plugs-payment/src/service/Payment.php @@ -442,8 +442,7 @@ abstract class Payment */ public static function leaveAmount(string $orderNo, $orderAmount): float { - $diff = round(round(floatval($orderAmount), 2) - self::paidAmount($orderNo, true), 2); - return $diff > 0 ? $diff : 0.00; + return round(max(floatval($orderAmount) - self::paidAmount($orderNo, true), 0), 2); } /**