wip
This commit is contained in:
1 parent
a02f762910
commit
a125dddb4c
3 files changed
+31
-16
No files matched your search
+17
-6
@@ -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'),
|
||||
|
||||
@@ -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,
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user