add ss_liga_code to torunaments
This commit is contained in:
1 parent
c8858574c1
commit
33e8107517
6 files changed
+49
-18
No files matched your search
@@ -29,14 +29,21 @@ trait GrappingTeams
|
||||
|
||||
$this->speed = $this->ask_speed();
|
||||
|
||||
$what = $this->select_what_to_grap();
|
||||
switch ($this->ask_restart()) {
|
||||
case 'clear':
|
||||
SofaScoreRosa::query()->update(['grapped' => 0]);
|
||||
File::cleanDirectory($this->data_dir);
|
||||
break;
|
||||
case 'restart':
|
||||
SofaScoreRosa::query()->update(['grapped' => 0]);
|
||||
break;
|
||||
|
||||
if ($this->restart) {
|
||||
SofaScoreRosa::query()->update(['grapped' => 0]);
|
||||
File::cleanDirectory($this->data_dir);
|
||||
default:
|
||||
// code...
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($what) {
|
||||
switch ($title = $this->select_what_to_grap()) {
|
||||
case 'major':
|
||||
$tournaments = SofaScoreTournament::where('enabled', 1)->whereIn('tournament_id', $major)->pluck('tournament_id')->toArray();
|
||||
break;
|
||||
@@ -45,6 +52,7 @@ trait GrappingTeams
|
||||
break;
|
||||
default:
|
||||
$tmp = self::load_tornament_ids();
|
||||
$title = 'rose_'.str_replace(',', '_', $tmp);
|
||||
$tournaments = explode(',', $tmp);
|
||||
break;
|
||||
}
|
||||
@@ -61,7 +69,7 @@ trait GrappingTeams
|
||||
|
||||
if ($this->debug) {
|
||||
$key++;
|
||||
echo "\n$key/$count\n";
|
||||
Notice::note($key / $count.' - '.$value->ss_team_name);
|
||||
}
|
||||
|
||||
$url = $this->base_url."api/v1/team/$value->ss_team_id/players";
|
||||
@@ -87,7 +95,7 @@ trait GrappingTeams
|
||||
$this->grapper_sleep($this->speed);
|
||||
}
|
||||
|
||||
$this->import_to_excel("rose_$what");
|
||||
$this->import_to_excel('rose', $title);
|
||||
|
||||
if ($this->debug) {
|
||||
Notice::note('DONE', 'bb');
|
||||
|
||||
Reference in new issue
Block a user