This commit is contained in:
salam committed 2026-10-28 12:27:22 +01:00
1 parent d1163b6692
commit d4a4d0c5f1
5 files changed
+11 -3

No files matched your search

@@ -52,6 +52,7 @@ class ImportDetails
'last_update',
'is_active',
'last_import',
'betradar_player_id',
]);
});
@@ -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],
]
);
}
});
+2 -1
View File
@@ -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);
+1
View File
@@ -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',
@@ -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();