update jbg

This commit is contained in:
Afiq
2022-04-01 10:27:57 +08:00
parent 458028fb51
commit 2ed406c36b
+15 -4
View File
@@ -12,7 +12,7 @@ class updateJbg extends Command
* *
* @var string * @var string
*/ */
protected $signature = 'update:jbg'; protected $signature = 'update:jbg {--all : all zone} {--1 : update zone 1} {--2 : update zone 2} {--3 : update zone3}';
/** /**
* The console command description. * The console command description.
@@ -38,13 +38,24 @@ class updateJbg extends Command
*/ */
public function handle() public function handle()
{ {
$updatejbg = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbgsemasa')->json(); if($this->option('all')){
$zone = 'all';
}else if($this->option('1')){
$zone = '1';
}else if ($this->option('2')){
$zone = '2';
}else if ($this->option('3')){
$zone = '3';
}
$updatejbg = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbgsemasa',[
'zone' => $zone
])->json();
$updatejbgLelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbglelong')->json(); $updatejbgLelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbglelong')->json();
$hapusGadaiNull = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/hapus/gadai/null')->json(); $hapusGadaiNull = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/hapus/gadai/null')->json();
if($updatejbg == 'successful'){ if($updatejbg == 'successful'){
return 0; $this->info('Success');
}else{ }else{
return 'failed'; $this->info('Failed');
} }
} }
} }