wip
This commit is contained in:
1 parent
49e883e49e
commit
41d91a7124
5 files changed
+231
-127
No files matched your search
@@ -76,10 +76,8 @@ class LoadEvents
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
|
||||
$res = LoadEventsQuery::load($filter, $handicap_range, $total_range, $match);
|
||||
|
||||
|
||||
$dataset_home = [];
|
||||
$dataset_away = [];
|
||||
$dataset_exp_home = [];
|
||||
@@ -107,7 +105,7 @@ class LoadEvents
|
||||
|
||||
$playing_date[] = $value['starttime']->format('Y-m-d H:i');
|
||||
|
||||
$results_per_event[] = $value['val_home'] . ' : ' . $value['val_away'];
|
||||
$results_per_event[] = $value['val_home'].' : '.$value['val_away'];
|
||||
|
||||
$val_home = (int) $value['val_home'];
|
||||
$val_away = (int) $value['val_away'];
|
||||
@@ -206,7 +204,7 @@ class LoadEvents
|
||||
}
|
||||
}
|
||||
if (isset($val_home) && isset($val_away)) {
|
||||
$events[] = $value['home'] . ' vs ' . $value['away'];
|
||||
$events[] = $value['home'].' vs '.$value['away'];
|
||||
|
||||
if ($team_id == $value['home_id']) {
|
||||
$dataset_home[] = $val_home;
|
||||
@@ -232,10 +230,10 @@ class LoadEvents
|
||||
$label2 = 'Opponent';
|
||||
}
|
||||
} else {
|
||||
$label1 = $match->home->ss_team_name . ' +';
|
||||
$label2 = $match->home->ss_team_name . ' -';
|
||||
$label3 = $match->away->ss_team_name . ' +';
|
||||
$label4 = $match->away->ss_team_name . ' -';
|
||||
$label1 = $match->home->ss_team_name.' +';
|
||||
$label2 = $match->home->ss_team_name.' -';
|
||||
$label3 = $match->away->ss_team_name.' +';
|
||||
$label4 = $match->away->ss_team_name.' -';
|
||||
$dataset_home2 = [];
|
||||
$dataset_away2 = [];
|
||||
|
||||
@@ -257,14 +255,22 @@ class LoadEvents
|
||||
break;
|
||||
}
|
||||
|
||||
// Home playing HOME done and commited
|
||||
if ($match->home_id == $value['home_id']) {
|
||||
if ($team_id == $value['home_id']) {
|
||||
$dataset_home[] = (int) $value['val_home'];
|
||||
$dataset_away[] = (int) $value['val_away'];
|
||||
} else {
|
||||
} elseif ($team_id == $value['away_id']) {
|
||||
$dataset_home[] = (int) $value['val_away'];
|
||||
$dataset_away[] = (int) $value['val_home'];
|
||||
}
|
||||
|
||||
// Home playing HOME done and commited
|
||||
// if ($match->home_id == $value['home_id']) {
|
||||
// $dataset_home[] = (int) $value['val_home'];
|
||||
// $dataset_away[] = (int) $value['val_away'];
|
||||
// } else {
|
||||
// $dataset_home[] = (int) $value['val_away'];
|
||||
// $dataset_away[] = (int) $value['val_home'];
|
||||
// }
|
||||
// Home playing AWAY done and commited
|
||||
if ($match->away_id == $value['home_id']) {
|
||||
$dataset_home2[] = (int) $value['val_home'];
|
||||
@@ -285,11 +291,13 @@ class LoadEvents
|
||||
}
|
||||
}
|
||||
|
||||
// dd($events, array_sum($dataset_home));
|
||||
// dd($events, array_sum($dataset_home), array_sum($dataset_away));
|
||||
// dd($events, count($dataset_home), count($dataset_away), count($dataset_home2), count($dataset_away2));
|
||||
|
||||
self::shortenEnding($labels, $dataset_home, $dataset_away);
|
||||
|
||||
// dd($dataset_home);
|
||||
|
||||
$data = [
|
||||
'datasets' => [
|
||||
[
|
||||
@@ -333,7 +341,7 @@ class LoadEvents
|
||||
];
|
||||
if ($team_id && $statistic_type == 'gls') {
|
||||
$data['datasets'][] = [
|
||||
'label' => 'Goals ' . $label1,
|
||||
'label' => 'Goals '.$label1,
|
||||
'events' => $events,
|
||||
'playing_date' => $playing_date,
|
||||
'results_per_event' => $results_per_event,
|
||||
@@ -345,7 +353,7 @@ class LoadEvents
|
||||
'hidden' => true,
|
||||
];
|
||||
$data['datasets'][] = [
|
||||
'label' => 'Goals ' . $label2,
|
||||
'label' => 'Goals '.$label2,
|
||||
'events' => $events,
|
||||
'playing_date' => $playing_date,
|
||||
'results_per_event' => $results_per_event,
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\PlayerProps;
|
||||
|
||||
class BoxNames
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
return [
|
||||
2 => 'DR',
|
||||
4 => 'MR',
|
||||
6 => 'LW',
|
||||
9 => 'DC',
|
||||
10 => 'DM',
|
||||
11 => 'MC',
|
||||
12 => 'AM',
|
||||
15 => 'SW',
|
||||
16 => 'DC',
|
||||
17 => 'DM',
|
||||
18 => 'MC',
|
||||
19 => 'AM',
|
||||
20 => 'SM',
|
||||
21 => 'ST',
|
||||
23 => 'DC',
|
||||
24 => 'DM',
|
||||
25 => 'MC',
|
||||
26 => 'AM',
|
||||
30 => 'DL',
|
||||
32 => 'ML',
|
||||
34 => 'RW',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\PlayerProps;
|
||||
|
||||
use App\Models\StatistikoConfig;
|
||||
use App\Models\StatistikoEvent;
|
||||
|
||||
class Expectations
|
||||
{
|
||||
public static function load(int $team_id)
|
||||
{
|
||||
$bettypes = ['gls', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
||||
$data = StatistikoEvent::where(function ($query) use ($team_id) {
|
||||
return $query->orWhere('home_id', $team_id)
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
})->get();
|
||||
|
||||
$count_events = $data->count();
|
||||
$count_events = ! $count_events ? 1 : $count_events;
|
||||
|
||||
$config = StatistikoConfig::pluck('value', 'varname')->toArray();
|
||||
$work = [];
|
||||
foreach ($config as $key => $value) {
|
||||
$work[$key] = 0;
|
||||
}
|
||||
|
||||
foreach ($data as $value) {
|
||||
foreach ($bettypes as $type) {
|
||||
if ($value['home_id'] == $team_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'] == $team_id) {
|
||||
$work[$type.'_away_made_total'] += $value[$type.'_a'];
|
||||
// $work[$type.'_away_made_home'] += $value[$type.'_a'];
|
||||
$work[$type.'_away_got_total'] += $value[$type.'_h'];
|
||||
// $work[$type.'_away_got_home'] += $value[$type.'_h'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$config = StatistikoConfig::pluck('value', 'varname')->toArray();
|
||||
foreach ($config as $key => $value) {
|
||||
$work[$key] = $work[$key] * $value;
|
||||
}
|
||||
|
||||
$aspettativa = [];
|
||||
foreach ($work as $key => $value) {
|
||||
if ($value) {
|
||||
$aspettativa[$key] = round($value /= $count_events, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$finals = [];
|
||||
foreach ($bettypes as $type) {
|
||||
$finals[$type]['home'] = 0;
|
||||
$finals[$type]['away'] = 0;
|
||||
}
|
||||
foreach ($aspettativa as $key => $value) {
|
||||
foreach ($bettypes as $type) {
|
||||
if (strpos($key, $type) !== false) {
|
||||
if (strpos($key, 'home') !== false) {
|
||||
$finals[$type]['home'] += $value;
|
||||
}
|
||||
if (strpos($key, 'away') !== false) {
|
||||
$finals[$type]['away'] += $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $finals;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\PlayerProps\BoxNames;
|
||||
use App\Filament\Widgets\PlayerProps\Expectations;
|
||||
use App\Filament\Widgets\PlayerProps\LineUpMap;
|
||||
use App\Livewire\PlayerCalculator;
|
||||
use App\Models\SofaScorePlayerPerSeason;
|
||||
use App\Models\SofaScorePlayerPosition;
|
||||
@@ -12,7 +15,6 @@ use App\Models\StatistikoEvent;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Widgets\Widget;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Livewire\Attributes\On;
|
||||
|
||||
class PlayerPropsDrop extends Widget
|
||||
@@ -49,9 +51,9 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->activeBoxes = $this->boxNames();
|
||||
$this->activeBoxes = BoxNames::load();
|
||||
|
||||
$this->lineUpMap = $this->lineUpMap();
|
||||
$this->lineUpMap = LineUpMap::load();
|
||||
|
||||
$this->player_on_field_counter = 0;
|
||||
|
||||
@@ -343,10 +345,13 @@ class PlayerPropsDrop extends Widget
|
||||
$team_id = $this->team_id;
|
||||
$res = StatisticFixtures::where('id', $this->match_id)->first();
|
||||
$asp_team = 0;
|
||||
$team_home_away = 'home';
|
||||
if ((int) $res->home_id == (int) $team_id) {
|
||||
$asp_team = (float) $res->exp_home;
|
||||
$team_home_away = 'home';
|
||||
} elseif ((int) $res->away_id == (int) $team_id) {
|
||||
$asp_team = (float) $res->exp_away;
|
||||
$team_home_away = 'away';
|
||||
}
|
||||
|
||||
$player_totals = SofaScorePlayerPerSeason::with('details')->where('total_min', '>', 0)->where('season', 'total')->where('ss_team_id', $team_id)->get();
|
||||
@@ -358,34 +363,6 @@ class PlayerPropsDrop extends Widget
|
||||
}
|
||||
}
|
||||
|
||||
$asp_team_others = $this->loadOthers($count_player, $team_id);
|
||||
|
||||
// Aspettativa Team di Riferimento
|
||||
// (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10.
|
||||
// Ad esempio per Remo (supponiamo 24 giocatori nel Roster esclusi i portieri): ATR = 1.2 * 24 / 10 = 2.88
|
||||
|
||||
$asp_team_riferimento = (float) $asp_team * $count_player / 10;
|
||||
|
||||
/***
|
||||
"id" => 35067
|
||||
"ss_player_id" => 233856
|
||||
"ss_team_id" => 3212
|
||||
"season" => "total"
|
||||
"total_events" => 12
|
||||
"total_min" => 667
|
||||
"average_min" => 56
|
||||
"events_played_home" => 7
|
||||
"events_played_away" => 0
|
||||
"minutes_played_home" => 398
|
||||
"minutes_played_away" => 274
|
||||
"goals" => 0
|
||||
"fouls" => 5
|
||||
"cards" => 2
|
||||
"offsides" => 0
|
||||
"shots_on_target" => 1
|
||||
"shots_off_target" => 0
|
||||
*/
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach ($player_totals as $val) {
|
||||
@@ -400,7 +377,6 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
$tmp['id_team'] = $team_id;
|
||||
$tmp['asp_team'] = $asp_team;
|
||||
$tmp['asp_team_riferimento'] = $asp_team_riferimento;
|
||||
$tmp['player_count_without_gk'] = $count_player;
|
||||
|
||||
$position_field = $this->get_position($ss_player_id);
|
||||
@@ -511,14 +487,13 @@ class PlayerPropsDrop extends Widget
|
||||
}
|
||||
}
|
||||
|
||||
// Log::debug('results', $results);
|
||||
// dd($asp_team_others);
|
||||
// "asp_team_riferimento_goals" => 4.4
|
||||
// "asp_team_riferimento_fouls" => 42.2
|
||||
// "asp_team_riferimento_offside" => 2.0
|
||||
// "asp_team_riferimento_card" => 8.8
|
||||
// "asp_team_riferimento_snt" => 15.4
|
||||
// "asp_team_riferimento_tsh" => 42.6
|
||||
$asp_team_all = Expectations::load($team_id);
|
||||
|
||||
// Aspettativa Team di Riferimento
|
||||
// (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10.
|
||||
// Ad esempio per Remo (supponiamo 24 giocatori nel Roster esclusi i portieri): ATR = 1.2 * 24 / 10 = 2.88
|
||||
|
||||
$asp_team_riferimento = (float) $asp_team * $count_player / 10;
|
||||
|
||||
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
||||
foreach ($bettypes as $bettype) {
|
||||
@@ -535,29 +510,34 @@ class PlayerPropsDrop extends Widget
|
||||
$results[$key]['asp_riferimento_goals'] = $asp_team_riferimento;
|
||||
break;
|
||||
case 'cards':
|
||||
$asp_referimento = $asp_team_all['crd'][$team_home_away];
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_others['asp_team_riferimento_card'] / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_card'] = $asp_team_others['asp_team_riferimento_card'];
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_referimento / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_card'] = $asp_referimento;
|
||||
break;
|
||||
case 'fouls':
|
||||
$asp_referimento = $asp_team_all['fls'][$team_home_away];
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_others['asp_team_riferimento_fouls'] / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_fouls'] = $asp_team_others['asp_team_riferimento_fouls'];
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_referimento / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_fouls'] = $asp_referimento;
|
||||
break;
|
||||
case 'offsides':
|
||||
$asp_referimento = $asp_team_all['ofs'][$team_home_away];
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_others['asp_team_riferimento_offside'] / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_offside'] = $asp_team_others['asp_team_riferimento_offside'];
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_referimento / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_offside'] = $asp_referimento;
|
||||
break;
|
||||
case 'total_shots':
|
||||
$asp_referimento = $asp_team_all['tsh'][$team_home_away];
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_others['asp_team_riferimento_tsh'] / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_tsh'] = $asp_team_others['asp_team_riferimento_tsh'];
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_referimento / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_tsh'] = $asp_referimento;
|
||||
break;
|
||||
case 'shots_on_target':
|
||||
$asp_referimento = $asp_team_all['snt'][$team_home_away];
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_others['asp_team_riferimento_snt'] / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_snt'] = $asp_team_others['asp_team_riferimento_snt'];
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_referimento / $total_bettype;
|
||||
$results[$key]['asp_team_riferimento_snt'] = $asp_referimento;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -609,9 +589,10 @@ class PlayerPropsDrop extends Widget
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
})->get();
|
||||
|
||||
$count_events = \count($res);
|
||||
$count_events = 0;
|
||||
|
||||
foreach ($res as $value) {
|
||||
$count_events++;
|
||||
if ($value->home_id == $team_id) {
|
||||
$arr['goals'] += $value->gls_h;
|
||||
$arr['fouls'] += $value->fls_h;
|
||||
@@ -619,7 +600,8 @@ class PlayerPropsDrop extends Widget
|
||||
$arr['card'] += $value->crd_h;
|
||||
$arr['snt'] += $value->snt_h;
|
||||
$arr['tsh'] += $value->tsh_h;
|
||||
} elseif ($value->away_id == $team_id) {
|
||||
}
|
||||
if ($value->away_id == $team_id) {
|
||||
$arr['goals'] += $value->gls_a;
|
||||
$arr['fouls'] += $value->fls_a;
|
||||
$arr['offside'] += $value->ofs_a;
|
||||
@@ -629,70 +611,15 @@ class PlayerPropsDrop extends Widget
|
||||
}
|
||||
}
|
||||
|
||||
$aspettativa = round($arr['fouls'] / $count_events, 1);
|
||||
|
||||
dd($arr['fouls'], $aspettativa, $count_events);
|
||||
|
||||
foreach ($arr as $name => $value) {
|
||||
$arr['asp_team_riferimento_'.$name] = (float) round($value / $count_events * $count_player / 10, 1);
|
||||
$arr['asp_team_riferimento_'.$name] = (float) round($value / $count_events, 1) * $count_player / 10;
|
||||
}
|
||||
dd($arr);
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
private function boxNames(): array
|
||||
{
|
||||
return [2 => 'DR', 4 => 'MR', 6 => 'LW', 9 => 'DC', 10 => 'DM', 11 => 'MC', 12 => 'AM', 15 => 'SW', 16 => 'DC', 17 => 'DM', 18 => 'MC', 19 => 'AM', 20 => 'SM', 21 => 'ST', 23 => 'DC', 24 => 'DM', 25 => 'MC', 26 => 'AM', 30 => 'DL', 32 => 'ML', 34 => 'RW'];
|
||||
}
|
||||
|
||||
private function lineUpMap(): array
|
||||
{
|
||||
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],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user