moon rental update for admin

This commit is contained in:
2019-04-29 03:22:43 -05:00
parent 0fdf183962
commit 57bdde247f
2 changed files with 10 additions and 13 deletions

View File

@@ -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

View File

@@ -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