From 4f272fc3a1ae657afeca7705ac289579b6f4448b Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Thu, 30 May 2019 19:47:40 -0500 Subject: [PATCH] moving structure works back to jobs --- app/Console/Commands/GetStructures.php | 12 ++------ app/Library/Structures/StructureHelper.php | 3 +- app/Models/Structure/Structure.php | 2 +- ..._05_29_072409_corporation_assets_table.php | 29 ------------------- 4 files changed, 5 insertions(+), 41 deletions(-) diff --git a/app/Console/Commands/GetStructures.php b/app/Console/Commands/GetStructures.php index 1a6ffdb00..715f2a36b 100644 --- a/app/Console/Commands/GetStructures.php +++ b/app/Console/Commands/GetStructures.php @@ -106,22 +106,14 @@ class GetStructuresCommand extends Command Log::critical("Failed to get structure list."); return null; } - - for($i = 1; $i <= $structures->pages; $i++) { - $sHelper = new StructureHelper($charId, $corpId, $i); - - $sHelper->Start(); - } - - /* + for($i = 1; $i <= $structures->pages; $i++) { $job = new JobProcessStructure; $job->charId = $charId; $job->corpId = $corpId; $job->page = $i; ProcessStructureJob::dispatch($job)->onQueue('structures'); - } - */ + } //Mark the job as finished $task->SetStopStatus(); diff --git a/app/Library/Structures/StructureHelper.php b/app/Library/Structures/StructureHelper.php index 9baa52ff8..bb145da23 100644 --- a/app/Library/Structures/StructureHelper.php +++ b/app/Library/Structures/StructureHelper.php @@ -3,6 +3,8 @@ /** * W4RP Services * GNU Public License + * + * Finally works in it's current state. Need to move to a job process. */ namespace App\Library\Structures; @@ -115,7 +117,6 @@ class StructureHelper { //Save the database record $st->save(); - dd($st); } } } diff --git a/app/Models/Structure/Structure.php b/app/Models/Structure/Structure.php index 59bf420bb..8559ed050 100644 --- a/app/Models/Structure/Structure.php +++ b/app/Models/Structure/Structure.php @@ -12,7 +12,7 @@ class Structure extends Model */ //Table Name - public $table = 'AllianceStructures'; + public $table = 'alliance_structures'; //Primary Key public $primaryKey = 'id'; diff --git a/database/migrations/2019_05_29_072409_corporation_assets_table.php b/database/migrations/2019_05_29_072409_corporation_assets_table.php index f23319fdf..d664276f7 100644 --- a/database/migrations/2019_05_29_072409_corporation_assets_table.php +++ b/database/migrations/2019_05_29_072409_corporation_assets_table.php @@ -41,34 +41,6 @@ class CorporationAssetsTable extends Migration }); } - if(!Schema::hasTable('AllianceStructures')) { - Schema::create('AllianceStructures', function(Blueprint $table) { - $table->increments('id'); - $table->string('structure_id')->unique(); - $table->string('structure_name'); - $table->string('solar_system_id'); - $table->string('solar_system_name')->nullable(); - $table->string('type_id'); - $table->string('corporation_id'); - $table->boolean('services'); - $table->string('state'); - $table->dateTime('state_timer_start')->nullable(); - $table->dateTime('state_timer_end')->nullable(); - $table->dateTime('fuel_expires')->nullable(); - $table->string('profile_id'); - $table->string('position_x'); - $table->string('position_y'); - $table->string('position_z'); - $table->dateTime('next_reinforce_apply')->nullable(); - $table->integer('next_reinforce_hour')->nullable(); - $table->integer('next_reinforce_weekday')->nullable(); - $table->integer('reinforce_hour'); - $table->integer('reinforce_weekday')->nullable(); - $table->dateTime('unanchors_at')->nullable(); - $table->timestamps(); - }); - } - if(!Schema::hasTable('alliance_services')) { Schema::create('alliance_services', function(Blueprint $table) { $table->increments('id'); @@ -104,7 +76,6 @@ class CorporationAssetsTable extends Migration public function down() { Schema::dropIfExists('alliance_structures'); - Schema::dropIfExists('AllianceStructures'); Schema::dropIfExists('alliance_services'); Schema::dropIfExists('alliance_assets'); }