finance helper

This commit is contained in:
2018-12-06 18:19:25 -06:00
parent c0b1273685
commit 4829f3d6c8

View File

@@ -153,10 +153,9 @@ class FinanceHelper {
private function GetCharCorp($charId) { private function GetCharCorp($charId) {
//Check for the character the user_to_corporation table //Check for the character the user_to_corporation table
//$found = DB::table('user_to_corporation')->where('character_id', $charId)->get(); //$found = DB::table('user_to_corporation')->where('character_id', $charId)->get();
$found = UserToCorporation::where('character_id', $charId)->get(); $found = UserToCorporation::where('character_id', $charId)->get(['corporation_id']);
dd($found->character_id);
//If we don't find the character in the table, then let's retrieve the information from ESI //If we don't find the character in the table, then let's retrieve the information from ESI
if($found == null) { if(!isset($found[0]->corporation_id)) {
//Get the configuration for ESI from the environmental variables //Get the configuration for ESI from the environmental variables
$config = config('esi'); $config = config('esi');
//Setup a new ESI container //Setup a new ESI container
@@ -184,7 +183,6 @@ class FinanceHelper {
return $character->corporation_id; return $character->corporation_id;
} else { } else {
//Return the corporation_id if it was found in the database as it is what the calling function is looking for //Return the corporation_id if it was found in the database as it is what the calling function is looking for
var_dump($found);
return $found->corporation_id; return $found->corporation_id;
} }
} }