-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02a5bf1
commit 9f6d0be
Showing
9 changed files
with
168 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Mutterschiff | ||
* Date: 06.02.2018 | ||
* Time: 23:22. | ||
*/ | ||
|
||
namespace FlyingFerret\Seat\WHTools\Commands; | ||
|
||
use Seat\Eveapi\Models\Corporation\CorporationInfo; | ||
use FlyingFerret\Seat\WHTools\Jobs\CertificatesSync; | ||
use Illuminate\Console\Command; | ||
|
||
class CorporationCertificateSync extends Command | ||
{ | ||
|
||
protected $signature = 'seat-whtools:CorporationCertificates:sync {--corporation_ids= : The id list of characters in SeAT (using , as separator)}'; | ||
|
||
protected $description = 'Fire a job which attempts to update certificate ranks for all characters in the give corporation'; | ||
|
||
public function handle() | ||
{ | ||
|
||
if(! is_null($this->option('corporation_ids'))) { | ||
// transform the argument list in an array | ||
$ids = explode(',', $this->option('corporation_ids')); | ||
$corporation_ids = collect(); | ||
|
||
$corporations = CorporationInfo::whereIn('corporation_id', $ids)->get(); | ||
|
||
} else { | ||
$corporations = CorporationInfo::all(); | ||
$this->info('A synchronization job has been queued in order to update all Corporation Member certificates.'); | ||
} | ||
foreach ($corporations as $corp) { | ||
dispatch(new CertificatesSync($corp)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,6 @@ | |
|
||
return [ | ||
|
||
'version' => '0.1.5', | ||
'version' => '0.1.6', | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
|
||
namespace FlyingFerret\Seat\WHTools\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class CharacterCertificate extends Model | ||
{ | ||
public $timestamps = true; | ||
|
||
protected $table = 'whtools-characterCertificates'; | ||
|
||
protected $fillable = ['character_id','character_name','certID','cert_name','rank']; | ||
|
||
public function certificate(){ | ||
return $this->hasOne('FlyingFerret\Seat\WHTools\Models\Certificate','certID','certID'); | ||
} | ||
public function character(){ | ||
return $this->hasOne(Seat\Eveapi\Models\Character\CharacterInfo::class ,'character_id','character_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/database/migrations/2020_02_03_010000_create_characterCertificates_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateCharacterCertificatesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('whtools-characterCertificates', function (Blueprint $table) { | ||
$table->bigInteger('character_id'); | ||
$table->string('character_name'); | ||
$table->integer('certID'); | ||
$table->string('cert_name'); | ||
$table->smallInteger('rank'); | ||
$table->timestamps(); | ||
}); | ||
|
||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('whtools-characterCertificates'); | ||
} | ||
} |
Oops, something went wrong.