corp journal job added to cron for testing
This commit is contained in:
@@ -3,16 +3,20 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Libraries
|
||||
use Commands\Library\CommandHelper;
|
||||
use App\Library\Finances\Helper\FinanceHelper;
|
||||
use App\Library\Esi\Esi;
|
||||
|
||||
use App\Models\Corporation\CorpStructure;
|
||||
//Jobs
|
||||
use App\Jobs\ProcessWalletJournalJob;
|
||||
|
||||
use Carbon\Carbon;
|
||||
//Models
|
||||
use App\Models\Corporation\CorpStructure;
|
||||
use App\Models\Jobs\JobProcessWalletJournal;
|
||||
|
||||
class CorpJournalCommand extends Command
|
||||
{
|
||||
@@ -64,6 +68,20 @@ class CorpJournalCommand extends Command
|
||||
$finance->GetWalletJournal(1, $charId->character_id);
|
||||
}
|
||||
|
||||
//Get the corps with structures, and dispatch jobs accordingly
|
||||
foreach($corps as $corp) {
|
||||
$charId = CorpStructure::where(['corporation_id' => $corp->corporation_id])->first();
|
||||
$pages = $finance->GetJournalPageCount(1, $charId->character_id);
|
||||
for($i = 1; $i <= $pages; $i++) {
|
||||
$job = new JobProcessWalletJournal;
|
||||
$job->division = $division;
|
||||
$job->charId = $charId;
|
||||
$job->page = $i;
|
||||
$job->save();
|
||||
ProcessWalletJournalJob::dispatch($job);
|
||||
}
|
||||
}
|
||||
|
||||
//Mark the job as finished
|
||||
$task->SetStopStatus();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use App\Library\Finances\Helper\FinanceHelper;
|
||||
|
||||
//App Models
|
||||
use App\Models\Jobs\ProcessWalletJournalJob as JobModel;
|
||||
use App\Models\Jobs\ProcessWalletJournalJobModel as JobModel;
|
||||
|
||||
class ProcessWalletJournalJob implements ShouldQueue
|
||||
{
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ namespace App\Models\Jobs;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProcessWalletJournalJob extends Model
|
||||
class JobProcessWalletJournal extends Model
|
||||
{
|
||||
//Table Name
|
||||
public $table = 'job_process_wallet_journal';
|
||||
Reference in New Issue
Block a user