From 3795557bc59ea35749365e21eb32b2ddc041b301 Mon Sep 17 00:00:00 2001 From: tokumeikoi Date: Sat, 26 Feb 2022 00:47:53 +0800 Subject: [PATCH] update: fix onetime refund issue --- app/Services/OrderService.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index 30f88394..48dce7b8 100644 --- a/app/Services/OrderService.php +++ b/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);