moons admin controller
This commit is contained in:
@@ -24,16 +24,21 @@ class LookupHelper {
|
||||
$esi = new Eseye();
|
||||
|
||||
//Attempt to find the character name in the LookupCharacter table to see if we can match it to an id
|
||||
$charId =
|
||||
$charId = CharacterToCorporation::where(['character_name' => $character])->get('character_id');
|
||||
if($charId == null) {
|
||||
//Get the character id from the ESI API.
|
||||
$response = $esi->setQueryString([
|
||||
'categories' => 'character',
|
||||
'search' => $character,
|
||||
'strict' => 'true',
|
||||
])->invoke('get', '/search/');
|
||||
|
||||
//Get the character id from the ESI API.
|
||||
$response = $esi->setQueryString([
|
||||
'categories' => 'character',
|
||||
'search' => $character,
|
||||
'strict' => 'true',
|
||||
])->invoke('get', '/search/');
|
||||
$this->LookupCharacter($response->character[0]);
|
||||
|
||||
return $reponse->character[0];
|
||||
return $response->character[0];
|
||||
} else {
|
||||
return $charId[0]->character_id;
|
||||
}
|
||||
}
|
||||
|
||||
//Add characters to the lookup table for quicker lookups without having
|
||||
|
||||
Reference in New Issue
Block a user