SetStartStatus(); //Setup the Finances Container $finance = new FinanceHelper(); //Setup an array to store corporations which have been logged so we don't keep calling the same ones. We need //this step in order to save time during the cronjob. $finishedCorps = array(); $corpCompleted = false; //Get the corps with structures logged in the database $corps = CorpStructure::select('corporation_id')->groupBy('corporation_id')->get(); foreach($corps as $corp) { $charId = CorpStructure::where(['corporation_id' => $corp->corporation_id])->first(); $finance->GetWalletJournal(1, $charId->character_id); } $finance->GetWalletJournal(3, 94415555); //Mark the job as finished $task->SetStopStatus(); } }