moon rental update for admin
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user