Explorar o código

update: fix onetime refund issue

tokumeikoi %!s(int64=3) %!d(string=hai) anos
pai
achega
3795557bc5
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      app/Services/OrderService.php

+ 1 - 0
app/Services/OrderService.php

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