update: fix onetime refund issue

This commit is contained in:
tokumeikoi 2022-02-26 00:47:53 +08:00
parent 632205fb6c
commit 3795557bc5

View File

@ -170,6 +170,7 @@ class OrderService
->first(); ->first();
if (!$lastOneTimeOrder) return; if (!$lastOneTimeOrder) return;
$plan = Plan::find($lastOneTimeOrder->plan_id); $plan = Plan::find($lastOneTimeOrder->plan_id);
if (!$plan) return;
$trafficUnitPrice = $plan->onetime_price / $plan->transfer_enable; $trafficUnitPrice = $plan->onetime_price / $plan->transfer_enable;
if ($user->discount && $trafficUnitPrice) { if ($user->discount && $trafficUnitPrice) {
$trafficUnitPrice = $trafficUnitPrice - ($trafficUnitPrice * $user->discount / 100); $trafficUnitPrice = $trafficUnitPrice - ($trafficUnitPrice * $user->discount / 100);