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
@@ -213,13 +213,9 @@ class MoonsAdminController extends Controller
if($contact != null) { if($contact != null) {
$contact = $contact->toArray(); $contact = $contact->toArray();
}
if(!isset($contact['Contact'])) {
$contact = 'None';
} else {
//Get the name of the character
$contact = $lookup->CharacterName($contact['Contact']); $contact = $lookup->CharacterName($contact['Contact']);
} else {
$contact = 'None';
} }
//Set the color for the table //Set the color for the table
+8 -7
View File
@@ -16,16 +16,17 @@ use App\Models\Lookups\CorporationToAlliance;
class LookupHelper { class LookupHelper {
public function CharacterName($charId) { public function CharacterName($charId) {
$name = ''; $esi = new Esye();
$temp = CharacterToCorporation::where(['character_id' => $charId])->get(['character_name']);
if(!isset($temp->character_name)) { try {
$name = 'None'; $character = $esi->invoke('get', '/characters/{character_id}/', [
} else { 'character_id' => $charId,
$name = $temp->character_name; ]);
} catch(RequestFailedException $e){
return null;
} }
return $name; return $character->name;
} }
//Create a character id from a character name //Create a character id from a character name