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 = DB::table('CorpStructures')->select('corporation_id')->groupBy('corporation_id')->get(); foreach($corps as $corp) { $this->line('Retrieving Corporation Journals for ' . $corp->corporation_id); $charId = DB::table('CorpStructures')->select('character_id')->where(['corporation_id' => $corp->corporation_id])->first(); $lastPage = $this->GetJournal($charId->character_id); $this->line('Last Page recorded was ' . $lastPage); $this->line('Received Corporation Journals for ' . $corp->corporation_id); } //Mark the job as finished $task->SetStopStatus(); } private function GetJournal($charId) { $finances = new FinanceHelper(); //Get the master wallet journal for the corporation for the character $lastPage = $finances->GetWalletJournal(1, $charId); return $lastPage; } }