Skip to content

Commit

Permalink
fix: 优化支付剩余统计
Browse files Browse the repository at this point in the history
  • Loading branch information
zoujingli committed Oct 9, 2024
1 parent 9d23188 commit 10d90e9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugin/think-plugs-payment/src/service/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,7 @@ public static function paidAmount(string $orderNo, bool $realtime = false): floa
*/
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);
}

/**
Expand Down

0 comments on commit 10d90e9

Please sign in to comment.