esi update for observers

This commit is contained in:
2021-03-21 22:33:32 +09:00
parent 78c05aadd3
commit 039fa1d44e

View File

@@ -92,12 +92,7 @@ class MiningTaxesObservers extends Command
//Run through the mining observers, and add them to the database
foreach($resp as $observer) {
//Declare the structure helper
$sHelper = new StructureHelper($config['primary'], $config['corporation']);
//Get the structure name from the universe endpoint to store in the database
$observerName = $sHelper->GetStructureName($observer->observer_id);
var_dump($observerName);
if($observer->observer_id > 1030000000000) {
$found = Observer::where([
'observer_id' => $observer->observer_id,
])->count();
@@ -108,18 +103,17 @@ class MiningTaxesObservers extends Command
])->update([
'observer_id' => $observer->observer_id,
'observer_type' => $observer->observer_type,
'observer_name' => $observerName,
'last_updated' => $observer->last_updated,
]);
} else {
$newObs = new Observer;
$newObs->observer_id = $observer->observer_id;
$newObs->observer_type = $observer->observer_type;
$newObs->observer_name = $observerName;
$newObs->last_updated = $observer->last_updated;
$newObs->save();
}
}
}
/**
* Cleanup stale data that hasn't been updated in at least 1 week.