From a125dddb4c55745c5b8919ecda51ceefea8d6244 Mon Sep 17 00:00:00 2001 From: salam Date: Thu, 29 Oct 2026 18:46:37 +0100 Subject: [PATCH] wip --- .../Schemas/StatistikoEventsForm.php | 23 ++++++++++++++----- app/Filament/Imports/Helper/ImportEvents.php | 22 ++++++++++-------- app/Models/StatistikoEvent.php | 2 ++ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/app/Filament/Clusters/StaticData/Resources/StatistikoEvents/Schemas/StatistikoEventsForm.php b/app/Filament/Clusters/StaticData/Resources/StatistikoEvents/Schemas/StatistikoEventsForm.php index c0a653c5..c5d87688 100644 --- a/app/Filament/Clusters/StaticData/Resources/StatistikoEvents/Schemas/StatistikoEventsForm.php +++ b/app/Filament/Clusters/StaticData/Resources/StatistikoEvents/Schemas/StatistikoEventsForm.php @@ -14,20 +14,31 @@ class StatistikoEventsForm ->components([ DateTimePicker::make('starttime')->native(false), TextInput::make('season'), + TextInput::make('gls_h'), TextInput::make('gls_a'), - TextInput::make('crn_h'), - TextInput::make('fls_h'), - TextInput::make('ofs_h'), - TextInput::make('snt_h'), - TextInput::make('tsh_h'), - TextInput::make('crd_h'), + TextInput::make('crn_a'), + TextInput::make('crn_h'), + + TextInput::make('fls_h'), TextInput::make('fls_a'), + + TextInput::make('ofs_h'), TextInput::make('ofs_a'), + + TextInput::make('snt_h'), TextInput::make('snt_a'), + + TextInput::make('tsh_h'), TextInput::make('tsh_a'), + + TextInput::make('crd_h'), TextInput::make('crd_a'), + + TextInput::make('wfl_h'), + TextInput::make('wfl_a'), + TextInput::make('exp_home'), TextInput::make('exp_away'), TextInput::make('exp_handicap'), diff --git a/app/Filament/Imports/Helper/ImportEvents.php b/app/Filament/Imports/Helper/ImportEvents.php index 4c842ebb..1220e1e4 100644 --- a/app/Filament/Imports/Helper/ImportEvents.php +++ b/app/Filament/Imports/Helper/ImportEvents.php @@ -13,7 +13,7 @@ class ImportEvents { $now = now()->format('Y-m-d H:i:s'); - SimpleExcelReader::create(storage_path('app/public/' . $filePath)) + SimpleExcelReader::create(storage_path('app/public/'.$filePath)) ->getRows() ->chunk(1000) ->each(function (LazyCollection $chunk) use ($now) { @@ -26,11 +26,11 @@ class ImportEvents * exp_home, exp_away, exp_handicap, exp_total */ if ( - (float) $row[21] != 0 - && (float) $row[22] != 0 - && (float) $row[23] != 0 + (float) $row[23] != 0 && (float) $row[24] != 0 - && (string) $row[25] != '' + && (float) $row[25] != 0 + && (float) $row[26] != 0 + && (string) $row[27] != '' ) { StatistikoEvent::updateOrCreate( @@ -58,11 +58,13 @@ class ImportEvents 'tsh_a' => (int) $row[18], 'crd_h' => (int) $row[19], 'crd_a' => (int) $row[20], - 'exp_home' => (float) $row[21], - 'exp_away' => (float) $row[22], - 'exp_handicap' => (float) $row[23], - 'exp_total' => (float) $row[24], - 'result_code' => (string) $row[25], // w, d, l + 'wfl_h' => (int) $row[21], + 'wfl_a' => (int) $row[22], + 'exp_home' => (float) $row[23], + 'exp_away' => (float) $row[24], + 'exp_handicap' => (float) $row[25], + 'exp_total' => (float) $row[26], + 'result_code' => (string) $row[27], // w, d, l 'created_at' => $now, 'updated_at' => $now, ] diff --git a/app/Models/StatistikoEvent.php b/app/Models/StatistikoEvent.php index a793964e..4d89a0e9 100644 --- a/app/Models/StatistikoEvent.php +++ b/app/Models/StatistikoEvent.php @@ -35,6 +35,8 @@ class StatistikoEvent extends Model 'tsh_a', 'crd_h', 'crd_a', + 'wfl_h', + 'wfl_a', 'exp_home', 'exp_away', 'exp_handicap',