diff --git a/app/Console/Commands/MiningTaxes/MiningTaxesInvoicesNew.php b/app/Console/Commands/MiningTaxes/MiningTaxesInvoicesNew.php index 0e4ab0f97..b3bde17fb 100644 --- a/app/Console/Commands/MiningTaxes/MiningTaxesInvoicesNew.php +++ b/app/Console/Commands/MiningTaxes/MiningTaxesInvoicesNew.php @@ -80,7 +80,24 @@ class MiningTaxesInvoicesNew extends Command * From the list of character ids, create an array of mains and alts to group together. */ foreach($charIds as $charId) { - + $invoice = array(); + $ores = array(); + $totalPrice = 0.00; + $body = null; + $mainId = null; + + //Determine if this character is an alt of someone else + $foundAlt = UserAlt::where([ + 'character_id' => $charId, + ])->get(); + + if($foundAlt > 0) { + $mainId = $foundAlt->main_id; + } else { + $mainId = $charId; + } + + } //Set the task as stopped diff --git a/app/Console/Commands/MiningTaxes/MiningTaxesObservers.php b/app/Console/Commands/MiningTaxes/MiningTaxesObservers.php index 8f054161e..80a57c9b3 100644 --- a/app/Console/Commands/MiningTaxes/MiningTaxesObservers.php +++ b/app/Console/Commands/MiningTaxes/MiningTaxesObservers.php @@ -12,6 +12,7 @@ use Seat\Eseye\Exceptions\RequestFailedException; use App\Library\Esi\Esi; use App\Library\Helpers\LookupHelper; use Commands\Library\CommandHelper; +use App\Library\Helpers\StructureHelper; //App Models use App\Models\MiningTax\Observer; @@ -91,12 +92,18 @@ class MiningTaxesObservers extends Command //Run through the mining observers, and add them to the database foreach($resp as $observer) { + //Declare the structure helper + $sHelper = new StructureHelper($config['primary'], $config['corporation'], $refreshToken); + + //Get the structure name from the universe endpoint to store in the database + $observerInfo = $sHelper->GetStructureInfo($observer->observer_id); Observer::updateOrInsert([ 'observer_id' => $observer->observer_id, ], [ 'observer_id' => $observer->observer_id, 'observer_type' => $observer->observer_type, + 'observer_name' => $observerInfo->name, 'last_updated' => $observer->last_updated, ]); } diff --git a/app/Http/Controllers/MiningTaxes/MiningTaxesController.php b/app/Http/Controllers/MiningTaxes/MiningTaxesController.php index 4156b27ae..7b6d1c897 100644 --- a/app/Http/Controllers/MiningTaxes/MiningTaxesController.php +++ b/app/Http/Controllers/MiningTaxes/MiningTaxesController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\MiningTaxes; //Internal Library use App\Http\Controllers\Controller; use Illuminate\Http\Request; +use DB; use Log; use Carbon\Carbon; use Khill\Lavacharts\Lavacharts; diff --git a/app/Jobs/Commands/Eve/ProcessSendEveMailJob.php b/app/Jobs/Commands/Eve/ProcessSendEveMailJob.php index e10537bdf..760bc1f9e 100644 --- a/app/Jobs/Commands/Eve/ProcessSendEveMailJob.php +++ b/app/Jobs/Commands/Eve/ProcessSendEveMailJob.php @@ -28,13 +28,6 @@ class ProcessSendEveMailJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; - /** - * Timeout in seconds - * With new rate limiting, we shouldn't use this timeout - * @var int - */ - //public $timeout = 3600; - /** * Retries * With new rate limiting, we need a retry basis versus timeout basis diff --git a/app/Models/MiningTax/Observer.php b/app/Models/MiningTax/Observer.php index eedb07a6f..e9bc5247b 100644 --- a/app/Models/MiningTax/Observer.php +++ b/app/Models/MiningTax/Observer.php @@ -24,5 +24,6 @@ class Observer extends Model 'last_updated', 'observer_id', 'observer_type', + 'observer_name', ]; } diff --git a/database/migrations/2021_01_10_164334_create_mining_tax_tables.php b/database/migrations/2021_01_10_164334_create_mining_tax_tables.php index 4a6901030..94ad05ce5 100644 --- a/database/migrations/2021_01_10_164334_create_mining_tax_tables.php +++ b/database/migrations/2021_01_10_164334_create_mining_tax_tables.php @@ -41,6 +41,7 @@ class CreateMiningTaxTables extends Migration $table->dateTime('last_updated'); $table->unsignedBigInteger('observer_id'); $table->string('observer_type'); + $table->string('observer_name'); $table->timestamps(); }); }