Update and fix broadband traffic
This commit is contained in:
@@ -5,7 +5,7 @@ namespace App\Console\Commands;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use App\Jobs\BroadbandTraffic as Job;
|
||||
use App\Models\AdslSupplier;
|
||||
use App\Models\Supplier;
|
||||
|
||||
class BroadbandTraffic extends Command
|
||||
{
|
||||
@@ -14,7 +14,8 @@ class BroadbandTraffic extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'broadband:traffic:import';
|
||||
protected $signature = 'broadband:traffic:import'.
|
||||
' {--s|supplier= : Supplier Name}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@@ -30,7 +31,14 @@ class BroadbandTraffic extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
foreach (AdslSupplier::active()->get() as $o)
|
||||
if ($this->option('supplier')) {
|
||||
$o = Supplier::where('name','like',$this->option('supplier'))->singleOrFail();
|
||||
|
||||
Job::dispatch($o);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (Supplier::active()->get() as $o)
|
||||
Job::dispatch($o);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user