fetchminingtaxesobservers
This commit is contained in:
@@ -13,6 +13,7 @@ use Carbon\Carbon;
|
|||||||
//Application Library
|
//Application Library
|
||||||
use Seat\Eseye\Exceptions\RequestFailedException;
|
use Seat\Eseye\Exceptions\RequestFailedException;
|
||||||
use App\Library\Esi\Esi;
|
use App\Library\Esi\Esi;
|
||||||
|
use App\Library\Helpers\LookupHelper;
|
||||||
use App\Library\Helpers\StructureHelper;
|
use App\Library\Helpers\StructureHelper;
|
||||||
|
|
||||||
//Models
|
//Models
|
||||||
@@ -103,7 +104,7 @@ class FetchMiningTaxesObservers implements ShouldQueue
|
|||||||
'observer_name' => $structureInfo->name,
|
'observer_name' => $structureInfo->name,
|
||||||
'last_updated' => $observer->last_updated,
|
'last_updated' => $observer->last_updated,
|
||||||
'solar_system_id' => $structureInfo->solar_system_id,
|
'solar_system_id' => $structureInfo->solar_system_id,
|
||||||
'solar_system_name' => $sHelper->GetSolarSystemName($structureInfo->solar_system_id),
|
'solar_system_name' => $lookup->SystemIdToName($structureInfo->solar_system_id),
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
//Add a new observer into the observer table
|
//Add a new observer into the observer table
|
||||||
@@ -113,7 +114,7 @@ class FetchMiningTaxesObservers implements ShouldQueue
|
|||||||
$newObs->observer_name = $structureInfo->name;
|
$newObs->observer_name = $structureInfo->name;
|
||||||
$newObs->last_updated = $observer->last_updated;
|
$newObs->last_updated = $observer->last_updated;
|
||||||
$newObs->solar_system_id = $structureInfo->solar_system_id;
|
$newObs->solar_system_id = $structureInfo->solar_system_id;
|
||||||
$newObs->solar_system_name = $sHelper->GetSolarSystemName($structureInfo->solar_system_id);
|
$newObs->solar_system_name = $lookup->SystemIdToName($structureInfo->solar_system_id);
|
||||||
$newObs->save();
|
$newObs->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use Log;
|
|||||||
use App\Jobs\Library\JobHelper;
|
use App\Jobs\Library\JobHelper;
|
||||||
use Seat\Eseye\Exceptions\RequestFailedException;
|
use Seat\Eseye\Exceptions\RequestFailedException;
|
||||||
use App\Library\Esi\Esi;
|
use App\Library\Esi\Esi;
|
||||||
use App\Library\Lookups\LookupHelper;
|
use App\Library\Helpers\LookupHelper;
|
||||||
|
|
||||||
//App Models
|
//App Models
|
||||||
use App\Models\Jobs\JobStatus;
|
use App\Models\Jobs\JobStatus;
|
||||||
@@ -73,19 +73,6 @@ class StructureHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetSolarSystemName($systemId) {
|
|
||||||
//Declare some variables
|
|
||||||
$lookup = new LookupHelper;
|
|
||||||
|
|
||||||
$solar = $lookup->SystemIdToName($systemId);
|
|
||||||
|
|
||||||
if($solar != null) {
|
|
||||||
return $solar;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function GetStructureName($structureId) {
|
public function GetStructureName($structureId) {
|
||||||
try {
|
try {
|
||||||
$info = $this->esi->invoke('get', '/universe/structures/{structure_id}/', [
|
$info = $this->esi->invoke('get', '/universe/structures/{structure_id}/', [
|
||||||
@@ -248,12 +235,13 @@ class StructureHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function SaveNewStructure($structure, $info) {
|
private function SaveNewStructure($structure, $info) {
|
||||||
|
//Declare helper variable needed
|
||||||
|
$lookup = new LookupHelper;
|
||||||
|
|
||||||
if(isset($info->solar_system_id)) {
|
if(isset($info->solar_system_id)) {
|
||||||
$solarName = $this->GetSolarSystemName($info->solar_system_id);
|
$solarName = $lookup->SolarSystemIdToName($info->solar_system_id);
|
||||||
} else {
|
} else {
|
||||||
Log::critical("Couldn't get solar system name for structure " . $structure->structure_id);
|
Log::critical("Couldn't get solar system name for structure " . $structure->structure_id . " in SaveNewStructure in StructureHelper.php");
|
||||||
Log::critical("Check access lists.");
|
|
||||||
$solarName = null;
|
$solarName = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user