update layout control vm
This commit is contained in:
@@ -65,9 +65,49 @@
|
||||
// Get service module info for IP
|
||||
$moduleService = $invoiceItem ? $invoiceItem->GetRelidProduct() : null;
|
||||
$ipAddress = '';
|
||||
|
||||
if ($moduleService) {
|
||||
if ($invoiceItem->product_type == 4 && isset($moduleService->ipAddress)) {
|
||||
$ipAddress = $moduleService->ipAddress->ip ?? '';
|
||||
// Try to get IP address from different sources
|
||||
if ($invoiceItem->product_type == 4) {
|
||||
// VPS - try multiple IP sources
|
||||
if (isset($moduleService->ipAddress) && $moduleService->ipAddress) {
|
||||
$ipAddress = $moduleService->ipAddress->ip ?? '';
|
||||
} elseif (isset($moduleService->ip_address) && $moduleService->ip_address) {
|
||||
$ipAddress = $moduleService->ip_address;
|
||||
} elseif (isset($moduleService->ip) && $moduleService->ip) {
|
||||
$ipAddress = $moduleService->ip;
|
||||
} elseif (isset($moduleService->primary_ip) && $moduleService->primary_ip) {
|
||||
$ipAddress = $moduleService->primary_ip;
|
||||
}
|
||||
} elseif ($invoiceItem->product_type == 3) {
|
||||
// Dedicated Server
|
||||
if (isset($moduleService->ip_address) && $moduleService->ip_address) {
|
||||
$ipAddress = $moduleService->ip_address;
|
||||
} elseif (isset($moduleService->ip) && $moduleService->ip) {
|
||||
$ipAddress = $moduleService->ip;
|
||||
} elseif (isset($moduleService->primary_ip) && $moduleService->primary_ip) {
|
||||
$ipAddress = $moduleService->primary_ip;
|
||||
}
|
||||
} elseif ($invoiceItem->product_type == 1) {
|
||||
// Shared Hosting
|
||||
if (isset($moduleService->ip_address) && $moduleService->ip_address) {
|
||||
$ipAddress = $moduleService->ip_address;
|
||||
} elseif (isset($moduleService->ip) && $moduleService->ip) {
|
||||
$ipAddress = $moduleService->ip;
|
||||
} elseif (isset($moduleService->server_ip) && $moduleService->server_ip) {
|
||||
$ipAddress = $moduleService->server_ip;
|
||||
}
|
||||
}
|
||||
|
||||
// If still no IP, try to get from invoice item directly
|
||||
if (empty($ipAddress)) {
|
||||
if (isset($invoiceItem->ip_address) && $invoiceItem->ip_address) {
|
||||
$ipAddress = $invoiceItem->ip_address;
|
||||
} elseif (isset($invoiceItem->ip) && $invoiceItem->ip) {
|
||||
$ipAddress = $invoiceItem->ip;
|
||||
} elseif (isset($invoiceItem->server_ip) && $invoiceItem->server_ip) {
|
||||
$ipAddress = $invoiceItem->server_ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
Reference in New Issue
Block a user