fix: 优化支付剩余统计

This commit is contained in:
邹景立 2024-10-09 21:33:10 +08:00
parent 9d231881d7
commit 10d90e9fb2

View File

@ -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);
}
/**