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(); //For all of the corporations, go through each structure and get wallet data foreach($corps as $corp) { //If the corporation isn't the holding corporation, then process the data. //We process holding corporation data elsewhere. if($corp->corporation_id != 98287666) { $structure = CorpStructure::where(['corporation_id' => $corp->corporation_id])->first(); $pages = $finance->GetJournalPageCount(1, $structure->character_id); for($i = 1; $i <= $pages; $i++) { $job = new JobProcessWalletJournal; $job->division = 1; $job->charId = $structure->character_id; $job->page = $i; ProcessWalletJournalJob::dispatch($job); } } } //Mark the job as finished $task->SetStopStatus(); } }