diff --git a/app/Filament/Imports/Helper/ImportDetails.php b/app/Filament/Imports/Helper/ImportDetails.php index 0b1688ab..e7b477da 100644 --- a/app/Filament/Imports/Helper/ImportDetails.php +++ b/app/Filament/Imports/Helper/ImportDetails.php @@ -52,6 +52,7 @@ class ImportDetails 'last_update', 'is_active', 'last_import', + 'betradar_player_id', ]); }); diff --git a/app/Filament/Imports/Helper/ImportFixtures.php b/app/Filament/Imports/Helper/ImportFixtures.php index d8956b43..6375df73 100644 --- a/app/Filament/Imports/Helper/ImportFixtures.php +++ b/app/Filament/Imports/Helper/ImportFixtures.php @@ -11,7 +11,7 @@ class ImportFixtures { public static function run(string $filePath): void { - SimpleExcelReader::create(storage_path('app/public/' . $filePath)) + SimpleExcelReader::create(storage_path('app/public/'.$filePath)) ->getRows() ->chunk(200) ->each(function (LazyCollection $chunk) { @@ -38,7 +38,11 @@ class ImportFixtures 'away_id' => (int) $row[3], 'starttime' => Carbon::parse($row[4])->toDateTimeString(), ], - ['exp_home' => (float) $row[5], 'exp_away' => (float) $row[6]] + [ + 'exp_home' => (float) $row[5], + 'exp_away' => (float) $row[6], + 'betradar_id' => (int) $row[9], + ] ); } }); diff --git a/app/Models/StatisticFixtures.php b/app/Models/StatisticFixtures.php index fcc8993d..6ed0b7ee 100644 --- a/app/Models/StatisticFixtures.php +++ b/app/Models/StatisticFixtures.php @@ -9,7 +9,9 @@ use Illuminate\Support\Carbon; class StatisticFixtures extends Model { use Prunable; + protected $fillable = [ + 'betradar_id', 'sport_id', 'league_id', 'home_id', @@ -34,7 +36,6 @@ class StatisticFixtures extends Model return static::where('starttime', '<', Carbon::now('Europe/Vienna')->subMinutes(5)); } - public function sport() { return $this->belongsTo(Sport::class)->where('is_active', 1); diff --git a/app/Models/StatistikoDetail.php b/app/Models/StatistikoDetail.php index 050f0796..b296dc83 100644 --- a/app/Models/StatistikoDetail.php +++ b/app/Models/StatistikoDetail.php @@ -16,6 +16,7 @@ class StatistikoDetail extends Model protected $fillable = [ 'ss_player_id', 'ss_team_id', + 'betradar_player_id', 'player_name', 'ss_national_team_id', 'birthdate', diff --git a/database/migrations/2026_04_17_094204_create_statistic_fixtures_table.php b/database/migrations/2026_04_17_094204_create_statistic_fixtures_table.php index 0af4a43d..82d34be9 100644 --- a/database/migrations/2026_04_17_094204_create_statistic_fixtures_table.php +++ b/database/migrations/2026_04_17_094204_create_statistic_fixtures_table.php @@ -13,6 +13,7 @@ return new class extends Migration { Schema::create('statistic_fixtures', function (Blueprint $table) { $table->id(); + $table->integer('betradar_id')->index(); $table->integer('sport_id')->index(); $table->integer('league_id')->index(); $table->integer('home_id')->index();