|
|
@@ -49,8 +49,9 @@ class PaymentProvider implements PaymentProviderInterface
|
|
|
throw new \RuntimeException('开发测试中,请稍后再试');
|
|
|
}
|
|
|
$payment->transaction(function () use ($bizType, $order, $payment) {
|
|
|
- $randomDiscount = mt_rand(1, intval($this->config->random_discount_max * 100)) / 100;
|
|
|
+ $randomDiscount = mt_rand(0, intval($this->config->random_discount_max * 100)) / 100;
|
|
|
$order['pay_amount'] = $order['pay_amount'] - $randomDiscount;
|
|
|
+ $order['pay_amount'] = max(0.01, round($order['pay_amount'], 2));
|
|
|
$payment->save([
|
|
|
'user_id' => $order['user_id'],
|
|
|
'order_id' => $order['id'],
|