moon rental update for admin
This commit is contained in:
@@ -213,13 +213,9 @@ class MoonsAdminController extends Controller
|
||||
|
||||
if($contact != null) {
|
||||
$contact = $contact->toArray();
|
||||
}
|
||||
|
||||
if(!isset($contact['Contact'])) {
|
||||
$contact = 'None';
|
||||
} else {
|
||||
//Get the name of the character
|
||||
$contact = $lookup->CharacterName($contact['Contact']);
|
||||
} else {
|
||||
$contact = 'None';
|
||||
}
|
||||
|
||||
//Set the color for the table
|
||||
|
||||
@@ -16,16 +16,17 @@ use App\Models\Lookups\CorporationToAlliance;
|
||||
class LookupHelper {
|
||||
|
||||
public function CharacterName($charId) {
|
||||
$name = '';
|
||||
$temp = CharacterToCorporation::where(['character_id' => $charId])->get(['character_name']);
|
||||
$esi = new Esye();
|
||||
|
||||
if(!isset($temp->character_name)) {
|
||||
$name = 'None';
|
||||
} else {
|
||||
$name = $temp->character_name;
|
||||
try {
|
||||
$character = $esi->invoke('get', '/characters/{character_id}/', [
|
||||
'character_id' => $charId,
|
||||
]);
|
||||
} catch(RequestFailedException $e){
|
||||
return null;
|
||||
}
|
||||
|
||||
return $name;
|
||||
return $character->name;
|
||||
}
|
||||
|
||||
//Create a character id from a character name
|
||||
|
||||
Reference in New Issue
Block a user