diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index 7b78e23e..7d3dc4c3 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -133,6 +133,7 @@ class OrderService $orderSurplusMonth = $orderSurplusMonth + $strToMonth[$item->cycle]; $orderSurplusAmount = $orderSurplusAmount + ($item['total_amount'] + $item['balance_amount']); } + if (!$orderSurplusMonth || !$orderSurplusAmount) return; $monthUnitPrice = $orderSurplusAmount / $orderSurplusMonth; // 如果用户过期月大于订单过期月 if ($userSurplusMonth > $orderSurplusMonth) { diff --git a/app/Utils/Helper.php b/app/Utils/Helper.php index 82dd5529..f53508ce 100755 --- a/app/Utils/Helper.php +++ b/app/Utils/Helper.php @@ -3,6 +3,7 @@ namespace App\Utils; use App\Models\Server; +use App\Models\ServerTrojan; use App\Models\User; class Helper @@ -56,7 +57,7 @@ class Helper return $str; } - public static function buildTrojanLink(Server $server, User $user) + public static function buildTrojanLink(ServerTrojan $server, User $user) { $uri = "trojan://{$user->uuid}@{$server->host}:{$server->port}"; $uri .= "\r\n";