moons admin controller

This commit is contained in:
2019-02-15 23:22:06 -06:00
parent bc3758331b
commit 8cd0744bab
+13 -8
View File
@@ -24,16 +24,21 @@ class LookupHelper {
$esi = new Eseye(); $esi = new Eseye();
//Attempt to find the character name in the LookupCharacter table to see if we can match it to an id //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. $this->LookupCharacter($response->character[0]);
$response = $esi->setQueryString([
'categories' => 'character',
'search' => $character,
'strict' => 'true',
])->invoke('get', '/search/');
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 //Add characters to the lookup table for quicker lookups without having