58 lines
836 B
PHP
58 lines
836 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Mass;
|
|
|
|
use App\Jobs\MassUpsert;
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\Bus;
|
|
|
|
class MassUpsertCommand extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'app:mass-upsert
|
|
{--count=100: number of rows inserted}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'mass upsert';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle()
|
|
{
|
|
$count = (int)$this->option('count');
|
|
|
|
Bus::chain([
|
|
(new \App\Jobs\Mass\MassUpsert\MassUpsert1Job($count)),
|
|
(new \App\Jobs\Mass\MassUpsert\MassUpsert2Job($count)),
|
|
])->dispatch();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|