This commit is contained in:
salam committed 2026-10-29 18:46:37 +01:00
1 parent a02f762910
commit a125dddb4c
3 files changed
+31 -16

No files matched your search

@@ -14,20 +14,31 @@ class StatistikoEventsForm
->components([ ->components([
DateTimePicker::make('starttime')->native(false), DateTimePicker::make('starttime')->native(false),
TextInput::make('season'), TextInput::make('season'),
TextInput::make('gls_h'), TextInput::make('gls_h'),
TextInput::make('gls_a'), 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_a'),
TextInput::make('crn_h'),
TextInput::make('fls_h'),
TextInput::make('fls_a'), TextInput::make('fls_a'),
TextInput::make('ofs_h'),
TextInput::make('ofs_a'), TextInput::make('ofs_a'),
TextInput::make('snt_h'),
TextInput::make('snt_a'), TextInput::make('snt_a'),
TextInput::make('tsh_h'),
TextInput::make('tsh_a'), TextInput::make('tsh_a'),
TextInput::make('crd_h'),
TextInput::make('crd_a'), TextInput::make('crd_a'),
TextInput::make('wfl_h'),
TextInput::make('wfl_a'),
TextInput::make('exp_home'), TextInput::make('exp_home'),
TextInput::make('exp_away'), TextInput::make('exp_away'),
TextInput::make('exp_handicap'), TextInput::make('exp_handicap'),
+12 -10
View File
@@ -13,7 +13,7 @@ class ImportEvents
{ {
$now = now()->format('Y-m-d H:i:s'); $now = now()->format('Y-m-d H:i:s');
SimpleExcelReader::create(storage_path('app/public/' . $filePath)) SimpleExcelReader::create(storage_path('app/public/'.$filePath))
->getRows() ->getRows()
->chunk(1000) ->chunk(1000)
->each(function (LazyCollection $chunk) use ($now) { ->each(function (LazyCollection $chunk) use ($now) {
@@ -26,11 +26,11 @@ class ImportEvents
* exp_home, exp_away, exp_handicap, exp_total * exp_home, exp_away, exp_handicap, exp_total
*/ */
if ( if (
(float) $row[21] != 0 (float) $row[23] != 0
&& (float) $row[22] != 0
&& (float) $row[23] != 0
&& (float) $row[24] != 0 && (float) $row[24] != 0
&& (string) $row[25] != '' && (float) $row[25] != 0
&& (float) $row[26] != 0
&& (string) $row[27] != ''
) { ) {
StatistikoEvent::updateOrCreate( StatistikoEvent::updateOrCreate(
@@ -58,11 +58,13 @@ class ImportEvents
'tsh_a' => (int) $row[18], 'tsh_a' => (int) $row[18],
'crd_h' => (int) $row[19], 'crd_h' => (int) $row[19],
'crd_a' => (int) $row[20], 'crd_a' => (int) $row[20],
'exp_home' => (float) $row[21], 'wfl_h' => (int) $row[21],
'exp_away' => (float) $row[22], 'wfl_a' => (int) $row[22],
'exp_handicap' => (float) $row[23], 'exp_home' => (float) $row[23],
'exp_total' => (float) $row[24], 'exp_away' => (float) $row[24],
'result_code' => (string) $row[25], // w, d, l 'exp_handicap' => (float) $row[25],
'exp_total' => (float) $row[26],
'result_code' => (string) $row[27], // w, d, l
'created_at' => $now, 'created_at' => $now,
'updated_at' => $now, 'updated_at' => $now,
] ]
+2
View File
@@ -35,6 +35,8 @@ class StatistikoEvent extends Model
'tsh_a', 'tsh_a',
'crd_h', 'crd_h',
'crd_a', 'crd_a',
'wfl_h',
'wfl_a',
'exp_home', 'exp_home',
'exp_away', 'exp_away',
'exp_handicap', 'exp_handicap',