add 2 parts for claculation pp wip

This commit is contained in:
salam committed 2026-10-31 19:22:16 +01:00
1 parent 6d2f4c1052
commit ad45880506
19 files changed
+1403 -1049

No files matched your search

+16 -15
View File
@@ -9,6 +9,7 @@ use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
use Filament\Notifications\Notification;
use Filament\Pages\Page;
use Illuminate\Support\Facades\Auth;
class EventMapper extends Page
{
@@ -36,9 +37,9 @@ class EventMapper extends Page
ActionGroup::make([
Action::make('bet365')
->extraAttributes(['x-on:click' => 'toggle'])
->visible(fn (): bool => auth()->user()->provider_id != 2)
->visible(fn (): bool => Auth::user()->provider_id != 2)
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 2]);
User::where('id', Auth::user()->id)->update(['provider_id' => 2]);
Notification::make()
->title('Event Mapper changed to Bet365')
@@ -49,10 +50,10 @@ class EventMapper extends Page
Action::make('magloo_nigeria')
->label('MAGLOO NIGERIA')
->extraAttributes(['x-on:click' => 'toggle'])
->visible(fn (): bool => in_array(auth()->user()->provider_id, [2, 4]))
->hidden(fn (): bool => ! in_array(auth()->user()->bookmaker_id, [10, 16]))
->visible(fn (): bool => in_array(Auth::user()->provider_id, [2, 4]))
->hidden(fn (): bool => ! in_array(Auth::user()->bookmaker_id, [10, 16]))
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 3]);
User::where('id', Auth::user()->id)->update(['provider_id' => 3]);
$livewire->dispatch('refresh');
Notification::make()
@@ -63,10 +64,10 @@ class EventMapper extends Page
Action::make('magloo_kenia')
->label('MAGLOO KENIA')
->extraAttributes(['x-on:click' => 'toggle'])
->visible(fn (): bool => in_array(auth()->user()->provider_id, [2, 3]))
->hidden(fn (): bool => ! in_array(auth()->user()->bookmaker_id, [10, 16]))
->visible(fn (): bool => in_array(Auth::user()->provider_id, [2, 3]))
->hidden(fn (): bool => ! in_array(Auth::user()->bookmaker_id, [10, 16]))
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 4]);
User::where('id', Auth::user()->id)->update(['provider_id' => 4]);
$livewire->dispatch('refresh');
Notification::make()
@@ -77,10 +78,10 @@ class EventMapper extends Page
Action::make('logifuture_nigeria')
->label('LOGIFUTURE NIGERA')
->extraAttributes(['x-on:click' => 'toggle'])
->visible(fn (): bool => auth()->user()->provider_id == 6)
->hidden(fn (): bool => ! in_array(auth()->user()->bookmaker_id, [35, 36]))
->visible(fn (): bool => Auth::user()->provider_id == 6)
->hidden(fn (): bool => ! in_array(Auth::user()->bookmaker_id, [35, 36]))
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 5]);
User::where('id', Auth::user()->id)->update(['provider_id' => 5]);
$livewire->dispatch('refresh');
@@ -92,10 +93,10 @@ class EventMapper extends Page
Action::make('logifuture_colombia')
->label('LOGIFUTURE COLOMBIA')
->extraAttributes(['x-on:click' => 'toggle'])
->visible(fn (): bool => auth()->user()->provider_id == 5)
->hidden(fn (): bool => ! in_array(auth()->user()->bookmaker_id, [35, 36]))
->visible(fn (): bool => Auth::user()->provider_id == 5)
->hidden(fn (): bool => ! in_array(Auth::user()->bookmaker_id, [35, 36]))
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 6]);
User::where('id', Auth::user()->id)->update(['provider_id' => 6]);
$livewire->dispatch('refresh');
@@ -107,7 +108,7 @@ class EventMapper extends Page
])
->label('Swop Bookmaker')
->icon('phosphor-dots-three-vertical')
->visible(fn (): bool => auth()->user()->hasRole('mapper_source_betsapi'))
->visible(fn (): bool => Auth::user()->hasRole('mapper_source_betsapi'))
->color('primary')
->button(),
];
+146 -38
View File
@@ -15,14 +15,19 @@ use Filament\Actions\Action;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Radio;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Slider;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Navigation\NavigationItem;
use Filament\Pages\Page;
use Filament\Schemas\Components\Grid;
use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Components\Utilities\Set;
use Filament\Schemas\Components\View;
use Filament\Schemas\Schema;
use Filament\Support\RawJs;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\HtmlString;
use Livewire\Attributes\On;
class PlayerProps extends Page implements HasForms
@@ -83,21 +88,28 @@ class PlayerProps extends Page implements HasForms
public function form(Schema $schema): Schema
{
return $schema
->columns(5)
->components([
$this->selectCountry(),
$this->selectLeague(),
$this->selectMatch(),
$this->selectTeam(),
$this->selectLineup(),
$this->radioSeasonOrDate(),
$this->datePickerStartDate(),
$this->datePickerEndDate(),
Grid::make(9)
->schema([
$this->selectCountry(),
$this->selectLeague(),
$this->selectMatch(),
$this->selectTeam(),
$this->selectLineup(),
$this->radioSeasonOrDate(),
$this->sliderValue(),
$this->selectSeason(),
$this->dateSplitter(),
View::make('components.form-lockout'),
])
->extraAttributes([
'wire:loading.class' => 'opacity-60 pointer-events-none transition-opacity',
]),
])->statePath('filterData');
}
#[On('team-update')]
public function syncData($team_id)
public function syncData(int $team_id)
{
if ($team_id) {
$this->team_id = $team_id;
@@ -191,6 +203,7 @@ class PlayerProps extends Page implements HasForms
private function selectTeam(): Select
{
return Select::make('tid')
->columnSpan(2)
->live()
->hiddenLabel()
->prefixIconColor(fn (Get $get): string => $get('tid') ? 'success' : 'danger')
@@ -211,8 +224,11 @@ class PlayerProps extends Page implements HasForms
->placeholder('Team')
->afterStateUpdated(function ($state, Set $set) {
if ($state) {
$this->dispatch('team-update', team_id: $state);
$tmp = SsLineupMemory::where('client_id', Auth::user()->client_id)->where('team_id', $state)->orderBy('created_at', 'desc')->first();
if ($tmp) {
$set('lineup', $tmp->lineup);
$this->dispatch('lineup-update', activeLineUp: $tmp->lineup);
@@ -224,6 +240,7 @@ class PlayerProps extends Page implements HasForms
private function selectLeague(): Select
{
return Select::make('lid')
->columnSpan(2)
->live()
->preload()
->prefixIconColor(fn (Get $get): string => $get('lid') ? 'success' : 'danger')
@@ -231,16 +248,18 @@ class PlayerProps extends Page implements HasForms
->hiddenLabel()
->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('cid')))
->placeholder('League')
->afterStateUpdated(function (callable $set) {
->afterStateUpdated(function (callable $set, $state) {
$set('mid', null);
$set('tid', null);
$this->dispatch('clear-all');
$this->dispatch('liga_id-update', liga_id: $state);
});
}
private function selectMatch(): Select
{
return Select::make('mid')
->columnSpan(2)
->live()
->hiddenLabel()
->prefixIconColor(fn (Get $get): string => $get('mid') ? 'success' : 'danger')
@@ -289,6 +308,7 @@ class PlayerProps extends Page implements HasForms
private function selectCountry(): Select
{
return Select::make('cid')
->columnSpan(2)
->live()
->preload()
->searchable(false)
@@ -306,6 +326,9 @@ class PlayerProps extends Page implements HasForms
});
}
/**
* SECOND LINE
*/
private function radioSeasonOrDate(): Radio
{
return Radio::make('season_or_date')
@@ -318,52 +341,137 @@ class PlayerProps extends Page implements HasForms
->default('season')
->hiddenLabel()
->options([
'season' => 'Active Season',
'season' => 'Season',
'date' => 'Date',
])->afterStateUpdated(function ($state) {
$this->dispatch('season_or_date-update', season_or_date: $state);
});
}
private function datePickerStartDate(): DatePicker
private function sliderValue(): Slider
{
return DatePicker::make('start_date')
return Slider::make('part_1_value')
->columnSpan(2)
->live(debounce: 500)
->hiddenLabel()
->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
->fillTrack()
->minValue(0)
->maxValue(100)
->default(60)
->decimalPlaces(0)
->tooltips(RawJs::make(<<<'JS'
`${$value.toFixed()}%`
JS))
->pips()
->afterStateUpdated(function ($state) {
$this->dispatch('part_1_value-update', part_1_value: $state);
});
}
private function selectSeason(): Select
{
return Select::make('season_selected')
->live()
->columnSpan(2)
->hiddenLabel()
->multiple()
->placeholder('Current Season')
->disabled(fn (Get $get) => $get('cid') == null)
->hidden(fn (Get $get) => $get('season_or_date') == 'date')
->prefixIconColor(fn (Get $get): string => $get('cid') ? 'success' : 'danger')
->prefixIcon('phosphor-calendar-star')
->suffixAction(
Action::make('iconInfo')
->icon('phosphor-question')
->color('success')
->tooltip(function (Get $get) {
if ($get('cid') == null) {
return 'Select country first';
} else {
return new HtmlString('Splits data in 2 Parts<br/><span class="text-blue-500">A) Seasons selected, value is % from slider</span><br/><span class="text-green-500">B) Contains rest from DB, value is 100 - slider value</span>');
}
}))
->options(function (Get $get) {
if ($get('season_mode') == 'halfyear') {
return ['26/27' => '26/27', '25/26' => '25/26', '24/25' => '24/25'];
} else {
return ['2026' => '2026', '2025' => '2025', '2024' => '2024'];
}
})
->afterStateUpdated(function (callable $set, $state) {
$set('ss_player_id', null);
$this->dispatch('season_selected-update', season_selected: $state);
});
}
private function dateSplitter(): DatePicker
{
return DatePicker::make('date_spliter')
->columnSpan(2)
->live()
->hiddenLabel()
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
->native(false)
->prefixAction(
Action::make('iconInfo')
->tooltip(fn () => new HtmlString('Splits data in 2 Parts<br/><span class="text-blue-500">A) Data before day selected, takes % from slider</span><br/><span class="text-green-500">B) Data after day selected takes rest, value is % 100 - slider value</span>'))
->icon('phosphor-question')
->color('success')
)
->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary')
->prefixIcon('phosphor-calendar')
->prefix('Start')
// ->prefixIcon('phosphor-calendar')
->prefix('Split')
->closeOnDateSelection()
->suffixAction(
Action::make('clear_start')
->icon('phosphor-x')
->color('gray')
->action(fn (Set $set) => $set('start_date', null))
->action(fn (Set $set) => $set('date_spliter', null))
)->afterStateUpdated(function ($state) {
$this->dispatch('start_date-update', start_date: $state);
$this->dispatch('date_spliter-update', $state);
});
}
private function datePickerEndDate(): DatePicker
{
return DatePicker::make('end_date')
->live()
->hiddenLabel()
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
->native(false)
->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary')
->prefixIcon('phosphor-calendar')
->prefix('End')
->closeOnDateSelection()
->suffixAction(
Action::make('clear_end')
->icon('phosphor-x')
->color('gray')
->action(fn (Set $set) => $set('end_date', null))
)->afterStateUpdated(function ($state) {
$this->dispatch('end_date-update', end_date: $state);
});
}
// private function datePickerStartDate(): DatePicker
// {
// return DatePicker::make('start_date')
// ->live()
// ->hiddenLabel()
// ->hidden(fn (Get $get) => $get('season_or_date') == 'season')
// ->native(false)
// ->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary')
// ->prefixIcon('phosphor-calendar')
// ->prefix('Start')
// ->closeOnDateSelection()
// ->suffixAction(
// Action::make('clear_start')
// ->icon('phosphor-x')
// ->color('gray')
// ->action(fn (Set $set) => $set('start_date', null))
// )->afterStateUpdated(function ($state) {
// $this->dispatch('start_date-update', start_date: $state);
// });
// }
// private function datePickerEndDate(): DatePicker
// {
// return DatePicker::make('end_date')
// ->live()
// ->hiddenLabel()
// ->hidden(fn (Get $get) => $get('season_or_date') == 'season')
// ->native(false)
// ->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary')
// ->prefixIcon('phosphor-calendar')
// ->prefix('End')
// ->closeOnDateSelection()
// ->suffixAction(
// Action::make('clear_end')
// ->icon('phosphor-x')
// ->color('gray')
// ->action(fn (Set $set) => $set('end_date', null))
// )->afterStateUpdated(function ($state) {
// $this->dispatch('end_date-update', end_date: $state);
// });
// }
}
@@ -1,276 +0,0 @@
<?php
namespace App\Filament\Widgets\PlayerProps;
use App\Models\StatisticFixtures;
use App\Models\StatistikoEvent;
class Expectations
{
public static function load(StatisticFixtures $match)
{
$home_id = $match->home_id;
$away_id = $match->away_id;
$data = StatistikoEvent::where(function ($query) use ($home_id, $away_id) {
return $query->whereIn('home_id', [$home_id, $away_id])->orWhereIn('away_id', [$home_id, $away_id]);
})->get();
$work = [];
$bettypes = ['gls', 'fls', 'crn', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
foreach ($data as $value) {
foreach ($bettypes as $type) {
if ($value['home_id'] == $home_id) {
$work[$type]['home_made_total'][] = $value[$type.'_h'];
$work[$type]['home_made_home'][] = $value[$type.'_h'];
$work[$type]['home_got_total'][] = $value[$type.'_a'];
$work[$type]['home_got_home'][] = $value[$type.'_a'];
} elseif ($value['away_id'] == $home_id) {
$work[$type]['home_made_total'][] = $value[$type.'_a'];
$work[$type]['home_got_total'][] = $value[$type.'_a'];
} elseif ($value['home_id'] == $away_id) {
$work[$type]['home_made_total'][] = $value[$type.'_a'];
$work[$type]['home_got_total'][] = $value[$type.'_a'];
} elseif ($value['away_id'] == $away_id) {
$work[$type]['home_made_total'][] = $value[$type.'_h'];
$work[$type]['home_made_home'][] = $value[$type.'_h'];
$work[$type]['home_got_total'][] = $value[$type.'_a'];
$work[$type]['home_got_home'][] = $value[$type.'_h'];
}
if ($value['away_id'] == $away_id) {
$work[$type]['away_made_total'][] = $value[$type.'_a'];
$work[$type]['away_made_away'][] = $value[$type.'_a'];
$work[$type]['away_got_total'][] = $value[$type.'_h'];
$work[$type]['away_got_away'][] = $value[$type.'_a'];
} elseif ($value['away_id'] == $home_id) {
$work[$type]['away_made_total'][] = $value[$type.'_h'];
$work[$type]['away_got_total'][] = $value[$type.'_h'];
} elseif ($value['home_id'] == $away_id) {
$work[$type]['away_made_total'][] = $value[$type.'_h'];
$work[$type]['away_got_total'][] = $value[$type.'_h'];
} elseif ($value['away_id'] == $away_id) {
$work[$type]['away_made_total'][] = $value[$type.'_a'];
$work[$type]['away_made_away'][] = $value[$type.'_a'];
$work[$type]['away_got_total'][] = $value[$type.'_h'];
$work[$type]['away_got_away'][] = $value[$type.'_a'];
}
}
}
$num_home_crd = 0;
$num_away_crd = 0;
$num_home_gls = 0;
$num_away_gls = 0;
$num_home_fls = 0;
$num_away_fls = 0;
$num_home_ofs = 0;
$num_away_ofs = 0;
$num_home_snt = 0;
$num_away_snt = 0;
$num_home_tsh = 0;
$num_away_tsh = 0;
$num_home_wfl = 0;
$num_away_wfl = 0;
$bettypes = ['gls', 'crd', 'fls', 'ofs', 'snt', 'tsh', 'wfl'];
foreach ($work as $type => $value) {
switch ($type) {
case 'gls':
$sum_home_gls = array_sum($value['home_made_total']);
$num_home_gls = \count($value['home_made_total']);
$sum_home_gls += array_sum($value['home_made_home']);
$num_home_gls += \count($value['home_made_home']);
$sum_home_gls += array_sum($value['home_got_total']);
$num_home_gls += \count($value['home_got_total']);
$sum_home_gls += array_sum($value['home_got_home']);
$num_home_gls += \count($value['home_got_home']);
$sum_away_gls = array_sum($value['away_made_total']);
$num_away_gls = \count($value['away_made_total']);
$sum_away_gls += array_sum($value['away_made_away']);
$num_away_gls += \count($value['away_made_away']);
$sum_away_gls += array_sum($value['away_got_total']);
$num_away_gls += \count($value['away_got_total']);
$sum_away_gls += array_sum($value['away_got_away']);
$num_away_gls += \count($value['away_got_away']);
break;
case 'crd':
$sum_home_crd = array_sum($value['home_made_total']);
$num_home_crd = \count($value['home_made_total']);
$sum_home_crd += array_sum($value['home_made_home']);
$num_home_crd += \count($value['home_made_home']);
$sum_home_crd += array_sum($value['home_got_total']);
$num_home_crd += \count($value['home_got_total']);
$sum_home_crd += array_sum($value['home_got_home']);
$num_home_crd += \count($value['home_got_home']);
$sum_away_crd = array_sum($value['away_made_total']);
$num_away_crd = \count($value['away_made_total']);
$sum_away_crd += array_sum($value['away_made_away']);
$num_away_crd += \count($value['away_made_away']);
$sum_away_crd += array_sum($value['away_got_total']);
$num_away_crd += \count($value['away_got_total']);
$sum_away_crd += array_sum($value['away_got_away']);
$num_away_crd += \count($value['away_got_away']);
break;
case 'fls':
$sum_home_fls = array_sum($value['home_made_total']);
$num_home_fls = \count($value['home_made_total']);
$sum_home_fls += array_sum($value['home_made_home']);
$num_home_fls += \count($value['home_made_home']);
$sum_home_fls += array_sum($value['home_got_total']);
$num_home_fls += \count($value['home_got_total']);
$sum_home_fls += array_sum($value['home_got_home']);
$num_home_fls += \count($value['home_got_home']);
$sum_away_fls = array_sum($value['away_made_total']);
$num_away_fls = \count($value['away_made_total']);
$sum_away_fls += array_sum($value['away_made_away']);
$num_away_fls += \count($value['away_made_away']);
$sum_away_fls += array_sum($value['away_got_total']);
$num_away_fls += \count($value['away_got_total']);
$sum_away_fls += array_sum($value['away_got_away']);
$num_away_fls += \count($value['away_got_away']);
break;
case 'ofs':
$sum_home_ofs = array_sum($value['home_made_total']);
$num_home_ofs = \count($value['home_made_total']);
$sum_home_ofs += array_sum($value['home_made_home']);
$num_home_ofs += \count($value['home_made_home']);
$sum_home_ofs += array_sum($value['home_got_total']);
$num_home_ofs += \count($value['home_got_total']);
$sum_home_ofs += array_sum($value['home_got_home']);
$num_home_ofs += \count($value['home_got_home']);
$sum_away_ofs = array_sum($value['away_made_total']);
$num_away_ofs = \count($value['away_made_total']);
$sum_away_ofs += array_sum($value['away_made_away']);
$num_away_ofs += \count($value['away_made_away']);
$sum_away_ofs += array_sum($value['away_got_total']);
$num_away_ofs += \count($value['away_got_total']);
$sum_away_ofs += array_sum($value['away_got_away']);
$num_away_ofs += \count($value['away_got_away']);
break;
case 'snt':
$sum_home_snt = array_sum($value['home_made_total']);
$num_home_snt = \count($value['home_made_total']);
$sum_home_snt += array_sum($value['home_made_home']);
$num_home_snt += \count($value['home_made_home']);
$sum_home_snt += array_sum($value['home_got_total']);
$num_home_snt += \count($value['home_got_total']);
$sum_home_snt += array_sum($value['home_got_home']);
$num_home_snt += \count($value['home_got_home']);
$sum_away_snt = array_sum($value['away_made_total']);
$num_away_snt = \count($value['away_made_total']);
$sum_away_snt += array_sum($value['away_made_away']);
$num_away_snt += \count($value['away_made_away']);
$sum_away_snt += array_sum($value['away_got_total']);
$num_away_snt += \count($value['away_got_total']);
$sum_away_snt += array_sum($value['away_got_away']);
$num_away_snt += \count($value['away_got_away']);
break;
case 'tsh':
$sum_home_tsh = array_sum($value['home_made_total']);
$num_home_tsh = \count($value['home_made_total']);
$sum_home_tsh += array_sum($value['home_made_home']);
$num_home_tsh += \count($value['home_made_home']);
$sum_home_tsh += array_sum($value['home_got_total']);
$num_home_tsh += \count($value['home_got_total']);
$sum_home_tsh += array_sum($value['home_got_home']);
$num_home_tsh += \count($value['home_got_home']);
$sum_away_tsh = array_sum($value['away_made_total']);
$num_away_tsh = \count($value['away_made_total']);
$sum_away_tsh += array_sum($value['away_made_away']);
$num_away_tsh += \count($value['away_made_away']);
$sum_away_tsh += array_sum($value['away_got_total']);
$num_away_tsh += \count($value['away_got_total']);
$sum_away_tsh += array_sum($value['away_got_away']);
$num_away_tsh += \count($value['away_got_away']);
break;
case 'wfl':
$sum_home_wfl = array_sum($value['home_made_total']);
$num_home_wfl = \count($value['home_made_total']);
$sum_home_wfl += array_sum($value['home_made_home']);
$num_home_wfl += \count($value['home_made_home']);
$sum_home_wfl += array_sum($value['home_got_total']);
$num_home_wfl += \count($value['home_got_total']);
$sum_home_wfl += array_sum($value['home_got_home']);
$num_home_wfl += \count($value['home_got_home']);
$sum_away_wfl = array_sum($value['away_made_total']);
$num_away_wfl = \count($value['away_made_total']);
$sum_away_wfl += array_sum($value['away_made_away']);
$num_away_wfl += \count($value['away_made_away']);
$sum_away_wfl += array_sum($value['away_got_total']);
$num_away_wfl += \count($value['away_got_total']);
$sum_away_wfl += array_sum($value['away_got_away']);
$num_away_wfl += \count($value['away_got_away']);
break;
}
}
$aspettativa = [];
$aspettativa['home']['gls'] = round($sum_home_gls / $num_home_gls, 1);
$aspettativa['home']['crd'] = round($sum_home_crd / $num_home_crd, 1);
$aspettativa['home']['fls'] = round($sum_home_fls / $num_home_fls, 1);
$aspettativa['home']['ofs'] = round($sum_home_ofs / $num_home_ofs, 1);
$aspettativa['home']['snt'] = round($sum_home_snt / $num_home_snt, 1);
$aspettativa['home']['tsh'] = round($sum_home_tsh / $num_home_tsh, 1);
$aspettativa['home']['wfl'] = round($sum_home_wfl / $num_home_wfl, 1);
$aspettativa['away']['gls'] = round($sum_away_gls / $sum_away_gls, 1);
$aspettativa['away']['crd'] = round($sum_away_crd / $num_away_crd, 1);
$aspettativa['away']['fls'] = round($sum_away_fls / $num_away_fls, 1);
$aspettativa['away']['ofs'] = round($sum_away_ofs / $num_away_ofs, 1);
$aspettativa['away']['snt'] = round($sum_away_snt / $num_away_snt, 1);
$aspettativa['away']['tsh'] = round($sum_away_tsh / $num_away_tsh, 1);
$aspettativa['away']['wfl'] = round($sum_away_wfl / $num_away_wfl, 1);
return $aspettativa;
}
}
@@ -1,122 +0,0 @@
<?php
namespace App\Filament\Widgets\PlayerProps;
class LineUpMap
{
public static function load()
{
return [
'3313' => [9, 16, 23, 11, 18, 25, 19, 6, 34, 21],
'3331' => [9, 16, 23, 17, 11, 25, 12, 19, 26, 21],
'3331-' => [9, 16, 23, 10, 18, 24, 12, 19, 26, 21],
'3331+' => [9, 16, 23, 11, 18, 25, 12, 19, 26, 21],
'3412-' => [9, 16, 23, 4, 10, 24, 32, 19, 20, 21],
'3412+' => [9, 16, 23, 4, 11, 25, 32, 19, 20, 21],
'3421-' => [9, 16, 23, 4, 10, 24, 32, 12, 26, 21],
'3421+' => [9, 16, 23, 4, 11, 25, 32, 12, 26, 21],
'343-' => [9, 16, 23, 4, 10, 24, 32, 6, 34, 21],
'343+' => [9, 16, 23, 4, 11, 25, 32, 6, 34, 21],
'3511' => [9, 16, 23, 4, 11, 17, 25, 32, 19, 21],
'3511-' => [9, 16, 23, 4, 10, 18, 24, 32, 19, 21],
'3511+' => [9, 16, 23, 4, 11, 18, 25, 32, 19, 21],
'352' => [9, 16, 23, 4, 11, 17, 25, 32, 20, 21],
'352-' => [9, 16, 23, 4, 10, 18, 24, 32, 20, 21],
'352+' => [9, 16, 23, 4, 11, 18, 25, 32, 20, 21],
'4132' => [2, 9, 23, 30, 17, 12, 19, 26, 20, 21],
'4213-' => [2, 9, 23, 30, 10, 24, 19, 6, 34, 21],
'4213+' => [2, 9, 23, 30, 11, 25, 19, 6, 34, 21],
'4222' => [2, 9, 23, 30, 10, 24, 12, 26, 20, 21],
'4231' => [2, 9, 23, 30, 10, 24, 12, 19, 26, 21],
'424' => [2, 9, 23, 30, 10, 24, 6, 34, 20, 21],
'4312' => [2, 9, 23, 30, 17, 11, 25, 19, 20, 21],
'4312-' => [2, 9, 23, 30, 10, 18, 24, 19, 20, 21],
'4312+' => [2, 9, 23, 30, 11, 18, 25, 19, 20, 21],
'4321' => [2, 9, 23, 30, 17, 11, 25, 12, 26, 21],
'4321-' => [2, 9, 23, 30, 10, 18, 24, 12, 26, 21],
'4321+' => [2, 9, 23, 30, 11, 18, 25, 12, 26, 21],
'433' => [2, 9, 23, 30, 17, 11, 25, 6, 34, 21],
'433-' => [2, 9, 23, 30, 10, 18, 24, 6, 34, 21],
'433+' => [2, 9, 23, 30, 11, 18, 25, 6, 34, 21],
'4411-' => [2, 9, 23, 30, 4, 10, 24, 32, 19, 21],
'4411+' => [2, 9, 23, 30, 4, 11, 25, 32, 19, 21],
'442' => [2, 9, 23, 30, 4, 17, 18, 32, 20, 21],
'442-' => [2, 9, 23, 30, 4, 10, 24, 32, 20, 21],
'442+' => [2, 9, 23, 30, 4, 11, 25, 32, 20, 21],
'451' => [2, 9, 23, 30, 4, 17, 11, 25, 32, 21],
'451-' => [2, 9, 23, 30, 4, 10, 18, 24, 32, 21],
'451+' => [2, 9, 23, 30, 4, 11, 18, 25, 32, 21],
'523-' => [2, 9, 16, 23, 30, 10, 24, 6, 34, 21],
'523+' => [2, 9, 16, 23, 30, 11, 25, 6, 34, 21],
'5311' => [2, 9, 16, 23, 30, 17, 11, 25, 19, 21],
'5311-' => [2, 9, 16, 23, 30, 10, 18, 24, 19, 21],
'5311+' => [2, 9, 16, 23, 30, 11, 18, 25, 19, 21],
'532' => [2, 9, 16, 23, 30, 17, 11, 25, 20, 21],
'532-' => [2, 9, 16, 23, 30, 10, 18, 24, 20, 21],
'532+' => [2, 9, 16, 23, 30, 11, 18, 25, 20, 21],
'541-' => [2, 9, 16, 23, 30, 4, 10, 24, 32, 21],
'541+' => [2, 9, 16, 23, 30, 4, 11, 25, 32, 21],
];
}
public static function get(string $key)
{
$lup = [
'3313' => [9, 16, 23, 11, 18, 25, 19, 6, 34, 21],
'3331' => [9, 16, 23, 17, 11, 25, 12, 19, 26, 21],
'3331-' => [9, 16, 23, 10, 18, 24, 12, 19, 26, 21],
'3331+' => [9, 16, 23, 11, 18, 25, 12, 19, 26, 21],
'3412-' => [9, 16, 23, 4, 10, 24, 32, 19, 20, 21],
'3412+' => [9, 16, 23, 4, 11, 25, 32, 19, 20, 21],
'3421-' => [9, 16, 23, 4, 10, 24, 32, 12, 26, 21],
'3421+' => [9, 16, 23, 4, 11, 25, 32, 12, 26, 21],
'343-' => [9, 16, 23, 4, 10, 24, 32, 6, 34, 21],
'343+' => [9, 16, 23, 4, 11, 25, 32, 6, 34, 21],
'3511' => [9, 16, 23, 4, 11, 17, 25, 32, 19, 21],
'3511-' => [9, 16, 23, 4, 10, 18, 24, 32, 19, 21],
'3511+' => [9, 16, 23, 4, 11, 18, 25, 32, 19, 21],
'352' => [9, 16, 23, 4, 11, 17, 25, 32, 20, 21],
'352-' => [9, 16, 23, 4, 10, 18, 24, 32, 20, 21],
'352+' => [9, 16, 23, 4, 11, 18, 25, 32, 20, 21],
'4132' => [2, 9, 23, 30, 17, 12, 19, 26, 20, 21],
'4213-' => [2, 9, 23, 30, 10, 24, 19, 6, 34, 21],
'4213+' => [2, 9, 23, 30, 11, 25, 19, 6, 34, 21],
'4222' => [2, 9, 23, 30, 10, 24, 12, 26, 20, 21],
'4231' => [2, 9, 23, 30, 10, 24, 12, 19, 26, 21],
'424' => [2, 9, 23, 30, 10, 24, 6, 34, 20, 21],
'4312' => [2, 9, 23, 30, 17, 11, 25, 19, 20, 21],
'4312-' => [2, 9, 23, 30, 10, 18, 24, 19, 20, 21],
'4312+' => [2, 9, 23, 30, 11, 18, 25, 19, 20, 21],
'4321' => [2, 9, 23, 30, 17, 11, 25, 12, 26, 21],
'4321-' => [2, 9, 23, 30, 10, 18, 24, 12, 26, 21],
'4321+' => [2, 9, 23, 30, 11, 18, 25, 12, 26, 21],
'433' => [2, 9, 23, 30, 17, 11, 25, 6, 34, 21],
'433-' => [2, 9, 23, 30, 10, 18, 24, 6, 34, 21],
'433+' => [2, 9, 23, 30, 11, 18, 25, 6, 34, 21],
'4411-' => [2, 9, 23, 30, 4, 10, 24, 32, 19, 21],
'4411+' => [2, 9, 23, 30, 4, 11, 25, 32, 19, 21],
'442' => [2, 9, 23, 30, 4, 17, 18, 32, 20, 21],
'442-' => [2, 9, 23, 30, 4, 10, 24, 32, 20, 21],
'442+' => [2, 9, 23, 30, 4, 11, 25, 32, 20, 21],
'451' => [2, 9, 23, 30, 4, 17, 11, 25, 32, 21],
'451-' => [2, 9, 23, 30, 4, 10, 18, 24, 32, 21],
'451+' => [2, 9, 23, 30, 4, 11, 18, 25, 32, 21],
'523-' => [2, 9, 16, 23, 30, 10, 24, 6, 34, 21],
'523+' => [2, 9, 16, 23, 30, 11, 25, 6, 34, 21],
'5311' => [2, 9, 16, 23, 30, 17, 11, 25, 19, 21],
'5311-' => [2, 9, 16, 23, 30, 10, 18, 24, 19, 21],
'5311+' => [2, 9, 16, 23, 30, 11, 18, 25, 19, 21],
'532' => [2, 9, 16, 23, 30, 17, 11, 25, 20, 21],
'532-' => [2, 9, 16, 23, 30, 10, 18, 24, 20, 21],
'532+' => [2, 9, 16, 23, 30, 11, 18, 25, 20, 21],
'541-' => [2, 9, 16, 23, 30, 4, 10, 24, 32, 21],
'541+' => [2, 9, 16, 23, 30, 4, 11, 25, 32, 21],
];
if (isset($lup[$key])) {
return $lup[$key];
}
return [];
}
}
File diff suppressed because it is too large. Load diff