diff --git a/app/Console/Commands/GrapperDaily.php b/app/Console/Commands/GrapperDaily.php index e74eef64..a3d1d99a 100644 --- a/app/Console/Commands/GrapperDaily.php +++ b/app/Console/Commands/GrapperDaily.php @@ -9,9 +9,9 @@ class GrapperDaily extends Command { use GrappingSofascore; - protected $signature = 'grp:day {--d} {--r} {--f}'; + protected $signature = 'grp:daily {--d} {--r} {--f}'; - protected $description = 'grap daily'; + protected $description = 'grap sofascore daily'; public function handleGrapper(): void { diff --git a/app/Traits/Sofascore/GrappingTournaments.php b/app/Traits/Sofascore/GrappingTournaments.php index 5452fc06..04e44ed6 100644 --- a/app/Traits/Sofascore/GrappingTournaments.php +++ b/app/Traits/Sofascore/GrappingTournaments.php @@ -59,10 +59,6 @@ trait GrappingTournaments while ($page) { // $data = $this->curl($url); - if ($this->debug) { - Notice::note('⚽ close all vpn and load tournaments'); - } - $this->sleep(); $url = $this->base_url."api/v1/sport/$slug/scheduled-tournaments/$day/page/$page"; @@ -186,10 +182,6 @@ trait GrappingTournaments Notice::note("$day Tournaments loaded", 'bb'); } - if ($this->debug) { - Notice::note('⚽ close all vpn'); - } - $this->day_tournaments = SofaScoreDayTournament::where('day', $day)->get(); if ($this->debug) { diff --git a/app/Traits/UpdateHelper.php b/app/Traits/UpdateHelper.php index f03a6629..2f467d25 100644 --- a/app/Traits/UpdateHelper.php +++ b/app/Traits/UpdateHelper.php @@ -291,8 +291,11 @@ trait UpdateHelper SofaScorePlayerPerSeason::whereIn('id', $idsToDelete)->delete(); } - Mail::to('hermann.telser@gmail.com')->send(new SimpleMail('STATISTIKO', 'Pre Calculation Completed')); - // Mail::to(['hermann.telser@gmail.com', 'ubaldo.perrucci@gmail.com'])->send(new SimpleMail('STATISTIKO', 'Pre Calculation Completed')); + SofaScorePlayerPerSeason::where('ss_player_id', 0)->delete(); + SofaScorePlayerPerSeason::where('season', null)->delete(); + + // Mail::to('hermann.telser@gmail.com')->send(new SimpleMail('STATISTIKO', 'Pre Calculation Completed')); + Mail::to(['hermann.telser@gmail.com', 'ubaldo.perrucci@gmail.com'])->send(new SimpleMail('STATISTIKO', 'Pre Calculation Completed')); } private function array_template(array &$collection, int $ss_player_id, string $season) diff --git a/database/migrations/2026_06_27_091506_create_sofa_score_player_per_seasons_table.php b/database/migrations/2026_06_27_091506_create_sofa_score_player_per_seasons_table.php index fbb49ba9..dff36b5d 100644 --- a/database/migrations/2026_06_27_091506_create_sofa_score_player_per_seasons_table.php +++ b/database/migrations/2026_06_27_091506_create_sofa_score_player_per_seasons_table.php @@ -31,7 +31,7 @@ return new class extends Migration $table->integer('shots_off_target')->default(0)->nullable(); $table->integer('shots_blocked')->default(0)->nullable(); $table->integer('total_shots')->default(0)->nullable(); - $table->unique(['ss_player_id', 'ss_team_id', 'season']); + $table->unique(['ss_player_id', 'season']); $table->timestamps(); }); }