wip
This commit is contained in:
1 parent
7708a4a935
commit
43d1c091b3
9 files changed
+165
-344
No files matched your search
@@ -1,113 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Actions;
|
|
||||||
|
|
||||||
use App\Models\SofaScorePlayerCache;
|
|
||||||
use App\Models\SofaScorePlayerPerSeason;
|
|
||||||
use App\Models\StatistikoDetail;
|
|
||||||
use App\Models\StatistikoPlayer;
|
|
||||||
|
|
||||||
class PlayerPerSeason
|
|
||||||
{
|
|
||||||
public static function run()
|
|
||||||
{
|
|
||||||
|
|
||||||
// when data changes clear player cache
|
|
||||||
SofaScorePlayerCache::truncate();
|
|
||||||
|
|
||||||
$res = StatistikoDetail::query()->where('is_active', 1)->select('ss_player_id', 'ss_team_id')->get();
|
|
||||||
|
|
||||||
foreach ($res as $val) {
|
|
||||||
|
|
||||||
$collection = [];
|
|
||||||
|
|
||||||
$res2 = StatistikoPlayer::with('event')->where('ss_player_id', $val->ss_player_id)->get();
|
|
||||||
|
|
||||||
foreach ($res2 as $val2) {
|
|
||||||
|
|
||||||
if (isset($val2->event->season)) {
|
|
||||||
if (! isset($collection['total'])) {
|
|
||||||
$collection['total']['events_played_home'] = 0;
|
|
||||||
$collection['total']['events_played_away'] = 0;
|
|
||||||
$collection['total']['minutes_played_home'] = 0;
|
|
||||||
$collection['total']['minutes_played_away'] = 0;
|
|
||||||
$collection['total']['goals'] = 0;
|
|
||||||
$collection['total']['fouls'] = 0;
|
|
||||||
$collection['total']['offsides'] = 0;
|
|
||||||
$collection['total']['shots_on_target'] = 0;
|
|
||||||
$collection['total']['shots_off_target'] = 0;
|
|
||||||
$collection['total']['cards'] = 0;
|
|
||||||
}
|
|
||||||
if (! isset($collection[$val2->event->season])) {
|
|
||||||
$collection[$val2->event->season]['events_played_home'] = 0;
|
|
||||||
$collection[$val2->event->season]['events_played_away'] = 0;
|
|
||||||
$collection[$val2->event->season]['minutes_played_home'] = 0;
|
|
||||||
$collection[$val2->event->season]['minutes_played_away'] = 0;
|
|
||||||
$collection[$val2->event->season]['goals'] = 0;
|
|
||||||
$collection[$val2->event->season]['fouls'] = 0;
|
|
||||||
$collection[$val2->event->season]['cards'] = 0;
|
|
||||||
$collection[$val2->event->season]['offsides'] = 0;
|
|
||||||
$collection[$val2->event->season]['shots_on_target'] = 0;
|
|
||||||
$collection[$val2->event->season]['shots_off_target'] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int) $val2->minutes_played > 0) {
|
|
||||||
if ($val2->activeteam_id == $val2->event->home_id) {
|
|
||||||
$collection[$val2->event->season]['events_played_home'] += 1;
|
|
||||||
$collection[$val2->event->season]['minutes_played_home'] += $val2->minutes_played;
|
|
||||||
$collection['total']['events_played_home'] += 1;
|
|
||||||
$collection['total']['minutes_played_home'] += $val2->minutes_played;
|
|
||||||
} elseif ($val2->activeteam_id == $val2->event->away_id) {
|
|
||||||
|
|
||||||
$collection[$val2->event->season]['events_played_away'] += 1;
|
|
||||||
$collection[$val2->event->season]['minutes_played_away'] += $val2->minutes_played;
|
|
||||||
$collection['total']['minutes_played_away'] += 1;
|
|
||||||
$collection['total']['minutes_played_away'] += $val2->minutes_played;
|
|
||||||
}
|
|
||||||
|
|
||||||
$cards = $val2->card_yellow + $val2->card_yellowred + $val2->card_red;
|
|
||||||
|
|
||||||
$collection[$val2->event->season]['goals'] += $val2->goals;
|
|
||||||
$collection[$val2->event->season]['fouls'] += $val2->fouls;
|
|
||||||
$collection[$val2->event->season]['cards'] += $cards;
|
|
||||||
$collection[$val2->event->season]['offsides'] += $val2->offsides;
|
|
||||||
$collection[$val2->event->season]['shots_on_target'] += $val2->shots_on_target;
|
|
||||||
$collection[$val2->event->season]['shots_off_target'] += $val2->shots_off_target;
|
|
||||||
|
|
||||||
$collection['total']['goals'] += $val2->goals;
|
|
||||||
$collection['total']['fouls'] += $val2->fouls;
|
|
||||||
$collection['total']['cards'] += $cards;
|
|
||||||
$collection['total']['offsides'] += $val2->offsides;
|
|
||||||
$collection['total']['shots_on_target'] += $val2->shots_on_target;
|
|
||||||
$collection['total']['shots_off_target'] += $val2->shots_off_target;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($collection as $season => $row) {
|
|
||||||
if ($val->ss_team_id && $val->ss_player_id) {
|
|
||||||
|
|
||||||
SofaScorePlayerPerSeason::updateOrCreate(
|
|
||||||
[
|
|
||||||
'ss_player_id' => $val->ss_player_id,
|
|
||||||
'ss_team_id' => $val->ss_team_id,
|
|
||||||
'season' => $season,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'events_played_home' => $row['events_played_home'],
|
|
||||||
'events_played_away' => $row['events_played_away'],
|
|
||||||
'minutes_played_home' => $row['minutes_played_home'],
|
|
||||||
'minutes_played_away' => $row['minutes_played_away'],
|
|
||||||
'goals' => $row['goals'],
|
|
||||||
'fouls' => $row['fouls'],
|
|
||||||
'cards' => $row['cards'],
|
|
||||||
'offsides' => $row['offsides'],
|
|
||||||
'shots_on_target' => $row['shots_on_target'],
|
|
||||||
'shots_off_target' => $row['shots_off_target'],
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,7 @@ class Upd extends Command
|
|||||||
|
|
||||||
protected $signature = 'update:player {--d}';
|
protected $signature = 'update:player {--d}';
|
||||||
|
|
||||||
protected $description = 'update sofa_score_player_per_seasons';
|
protected $description = 'update ss_player_seasons';
|
||||||
|
|
||||||
public function handleUpdate(int $playerCount): void
|
public function handleUpdate(int $playerCount): void
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ use Filament\Tables\Contracts\HasTable;
|
|||||||
use Filament\Tables\Enums\FiltersLayout;
|
use Filament\Tables\Enums\FiltersLayout;
|
||||||
use Filament\Tables\Filters\SelectFilter;
|
use Filament\Tables\Filters\SelectFilter;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
use Illuminate\Support\HtmlString;
|
use Illuminate\Support\HtmlString;
|
||||||
use Livewire\Attributes\On;
|
use Livewire\Attributes\On;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
@@ -40,6 +39,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
public array $sourceRecords = [];
|
public array $sourceRecords = [];
|
||||||
|
|
||||||
public array $filters = [];
|
public array $filters = [];
|
||||||
|
|
||||||
public int $player_on_field_counter = 0;
|
public int $player_on_field_counter = 0;
|
||||||
|
|
||||||
// slider
|
// slider
|
||||||
@@ -58,7 +58,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
|
|
||||||
public bool $rangeXDisabled = true;
|
public bool $rangeXDisabled = true;
|
||||||
|
|
||||||
public string $ss_team_name = '';
|
public string $team_name = '';
|
||||||
|
|
||||||
public array $lineupsMap = [
|
public array $lineupsMap = [
|
||||||
'3313' => [9, 16, 23, 11, 18, 25, 19, 6, 34, 21],
|
'3313' => [9, 16, 23, 11, 18, 25, 19, 6, 34, 21],
|
||||||
@@ -176,7 +176,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
{
|
{
|
||||||
$this->filters = $filters;
|
$this->filters = $filters;
|
||||||
|
|
||||||
$this->ss_team_name = SofaScoreRosa::where('ss_team_id', $filters['team_id'])->value('ss_team_name');
|
$this->team_name = SofaScoreRosa::where('ss_team_id', $filters['team_id'])->value('ss_team_name');
|
||||||
|
|
||||||
$this->sourceRecords = PlayerCalculator::load($filters);
|
$this->sourceRecords = PlayerCalculator::load($filters);
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
<div>Crd</div>
|
<div>Crd</div>
|
||||||
<div>Foot</div>
|
<div>Foot</div>
|
||||||
<div>Evt</div>
|
<div>Evt</div>
|
||||||
<div>Ømin</div>
|
<div>Min Ø</div>
|
||||||
</div>');
|
</div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,26 +245,19 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
->modalWidth(Width::ExtraLarge)
|
->modalWidth(Width::ExtraLarge)
|
||||||
->modalSubmitAction(false)
|
->modalSubmitAction(false)
|
||||||
->modalCancelAction(false)
|
->modalCancelAction(false)
|
||||||
->modalContent(fn() => view('filament.modals.position-abbreviation')),
|
->modalContent(fn () => view('filament.modals.position-abbreviation')),
|
||||||
Action::make('reset')
|
Action::make('reset')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->size(Size::Small)
|
->size(Size::Small)
|
||||||
->tooltip('Remove all players from field')
|
->tooltip('Remove all players from field')
|
||||||
->icon('phosphor-arrows-clockwise')
|
->icon('phosphor-arrows-clockwise')
|
||||||
->action(fn() => $this->clearResultTable()),
|
->action(fn () => $this->clearResultTable()),
|
||||||
// Action::make('calculate')
|
|
||||||
// ->hiddenLabel()
|
|
||||||
// ->tooltip('Calculate expected values')
|
|
||||||
// ->size(Size::Small)
|
|
||||||
// ->icon('phosphor-calculator')
|
|
||||||
// ->disabled($this->calculationDisabled)
|
|
||||||
// ->action(fn () => $this->calculateAspg()),
|
|
||||||
Action::make('copy')
|
Action::make('copy')
|
||||||
->tooltip('Copy results for pasting into a spread sheet')
|
->tooltip('Copy results for pasting into a spread sheet')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->size(Size::Small)
|
->size(Size::Small)
|
||||||
->icon('phosphor-copy')
|
->icon('phosphor-copy')
|
||||||
->action(fn() => $this->copyResult()),
|
->action(fn () => $this->copyResult()),
|
||||||
])
|
])
|
||||||
/**
|
/**
|
||||||
* WICHTIG: Da Filament v5 zwingend eine Query braucht, nutzen wir ein
|
* WICHTIG: Da Filament v5 zwingend eine Query braucht, nutzen wir ein
|
||||||
@@ -277,11 +270,11 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
->columns([
|
->columns([
|
||||||
ViewColumn::make('drag_card')
|
ViewColumn::make('drag_card')
|
||||||
->columnSpanFull()
|
->columnSpanFull()
|
||||||
->label(fn() => $this->getHeadingTable())
|
->label(fn () => $this->getHeadingTable())
|
||||||
->view('filament.tables.columns.drag-card'),
|
->view('filament.tables.columns.drag-card'),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
SelectFilter::make('position_area')
|
SelectFilter::make('area')
|
||||||
->columnSpanFull()
|
->columnSpanFull()
|
||||||
->native(false)
|
->native(false)
|
||||||
->options([
|
->options([
|
||||||
@@ -293,7 +286,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
'midfield' => '<span class="text-blue-500">Midfield</span>',
|
'midfield' => '<span class="text-blue-500">Midfield</span>',
|
||||||
'defence' => '<span class="text-green-500">Defence</span>',
|
'defence' => '<span class="text-green-500">Defence</span>',
|
||||||
'goalkeeper' => '<span class="text-gray-500">Goalkeeper</span>',
|
'goalkeeper' => '<span class="text-gray-500">Goalkeeper</span>',
|
||||||
])->modifyFormFieldUsing(fn(Select $component) => $component->allowHtml())
|
])->modifyFormFieldUsing(fn (Select $component) => $component->allowHtml())
|
||||||
->query(function ($query) {
|
->query(function ($query) {
|
||||||
return $query;
|
return $query;
|
||||||
})->indicateUsing(function (array $data): array {
|
})->indicateUsing(function (array $data): array {
|
||||||
@@ -304,9 +297,9 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
->deferFilters(false)
|
->deferFilters(false)
|
||||||
->records(function () {
|
->records(function () {
|
||||||
$collection = collect($this->sourceRecords);
|
$collection = collect($this->sourceRecords);
|
||||||
$selectedPosition = $this->tableFilters['position_area']['value'] ?? null;
|
$selectedPosition = $this->tableFilters['area']['value'] ?? null;
|
||||||
if (! empty($selectedPosition)) {
|
if (! empty($selectedPosition)) {
|
||||||
$collection = $collection->where('position_area', $selectedPosition);
|
$collection = $collection->where('area', $selectedPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $collection;
|
return $collection;
|
||||||
@@ -338,7 +331,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
}
|
}
|
||||||
$this->boxes[$boxNumber] = $record;
|
$this->boxes[$boxNumber] = $record;
|
||||||
$this->sourceRecords[$k]['active'] = 1;
|
$this->sourceRecords[$k]['active'] = 1;
|
||||||
$this->sourceRecords[$k]['position'] = $this->activeBoxes[$boxNumber];
|
$this->sourceRecords[$k]['pos'] = $this->activeBoxes[$boxNumber];
|
||||||
|
|
||||||
$this->player_on_field_counter++;
|
$this->player_on_field_counter++;
|
||||||
}
|
}
|
||||||
@@ -372,7 +365,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
foreach ($this->sourceRecords as $k => $record) {
|
foreach ($this->sourceRecords as $k => $record) {
|
||||||
if ($record['id'] == (int) $player_id) {
|
if ($record['id'] == (int) $player_id) {
|
||||||
$this->boxes[$boxNumber] = [];
|
$this->boxes[$boxNumber] = [];
|
||||||
$this->sourceRecords[$k]['position'] = '';
|
$this->sourceRecords[$k]['pos'] = '';
|
||||||
$this->sourceRecords[$k]['active'] = 0;
|
$this->sourceRecords[$k]['active'] = 0;
|
||||||
|
|
||||||
$this->player_on_field_counter--;
|
$this->player_on_field_counter--;
|
||||||
@@ -396,7 +389,6 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
$this->boxes[$i] = [];
|
$this->boxes[$i] = [];
|
||||||
}
|
}
|
||||||
foreach ($this->sourceRecords as $k => $record) {
|
foreach ($this->sourceRecords as $k => $record) {
|
||||||
$this->sourceRecords[$k]['position'] = '';
|
|
||||||
$this->sourceRecords[$k]['active'] = 0;
|
$this->sourceRecords[$k]['active'] = 0;
|
||||||
$this->sourceRecords[$k]['gls'] = '';
|
$this->sourceRecords[$k]['gls'] = '';
|
||||||
$this->sourceRecords[$k]['fls'] = '';
|
$this->sourceRecords[$k]['fls'] = '';
|
||||||
@@ -411,45 +403,47 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
|
|
||||||
public function copyResult()
|
public function copyResult()
|
||||||
{
|
{
|
||||||
if ($this->player_on_field_counter < 10)
|
if ($this->player_on_field_counter < 10) {
|
||||||
return;
|
return;
|
||||||
// "id" => 787607
|
}
|
||||||
// "name" => "Keno"
|
// "id" => 1218016
|
||||||
// "preferred_foot" => "Right"
|
// "name" => "Walter Nuñez"
|
||||||
// "player_position" => "LW"
|
// "pos" => "LW"
|
||||||
// "position_area" => "attack"
|
// "foot" => "Right"
|
||||||
// "player_color" => "warning"
|
// "tot_evt" => 2
|
||||||
// "timed_color" => "danger"
|
// "tot_min" => 102
|
||||||
// "events_played" => 7
|
// "ave_min" => 51
|
||||||
// "everage_minutes" => 11
|
|
||||||
// "position" => "DC"
|
|
||||||
// "active" => 1
|
|
||||||
// "gls" => 0
|
// "gls" => 0
|
||||||
// "fls" => 0
|
// "fls" => 3
|
||||||
// "ofs" => 0
|
// "ofs" => 0
|
||||||
|
// "crd" => 0
|
||||||
// "snt" => 0
|
// "snt" => 0
|
||||||
// "tsh" => 0
|
// "tsh" => 0
|
||||||
// "crd" => 0
|
// "color_evt" => "success"
|
||||||
|
// "area" => "attack"
|
||||||
|
// "color_pos" => "warning"
|
||||||
$header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'snt', 'tsh', 'crd'];
|
$header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'snt', 'tsh', 'crd'];
|
||||||
$copystring = implode("\t", $header) . "\n";
|
$copystring = implode("\t", $header)."\n";
|
||||||
foreach ($this->sourceRecords as $row) {
|
foreach ($this->sourceRecords as $row) {
|
||||||
$tmp = [];
|
$tmp = [];
|
||||||
$tmp[] = $row['name'];
|
$tmp[] = $row['name'];
|
||||||
$tmp[] = $row['preferred_foot'];
|
$tmp[] = $row['foot'];
|
||||||
$tmp[] = $row['events_played'];
|
$tmp[] = $row['tot_evt'];
|
||||||
$tmp[] = $row['everage_minutes'];
|
$tmp[] = $row['ave_min'];
|
||||||
if ($row['position'])
|
if ($row['pos']) {
|
||||||
$tmp[] = $row['position'];
|
$tmp[] = $row['pos'];
|
||||||
else
|
} else {
|
||||||
$tmp[] = $row['player_position'];
|
$tmp[] = $row['pos_ori'];
|
||||||
|
}
|
||||||
$tmp[] = $row['active'];
|
$tmp[] = $row['active'];
|
||||||
$tmp[] = $row['gls'];
|
$tmp[] = $row['gls'];
|
||||||
$tmp[] = $row['fls'];
|
$tmp[] = $row['fls'];
|
||||||
$tmp[] = $row['ofs'];
|
$tmp[] = $row['ofs'];
|
||||||
|
$tmp[] = $row['snt'];
|
||||||
$tmp[] = $row['tsh'];
|
$tmp[] = $row['tsh'];
|
||||||
$tmp[] = $row['crd'];
|
$tmp[] = $row['crd'];
|
||||||
|
|
||||||
$copystring .= implode("\t", $tmp) . "\n";
|
$copystring .= implode("\t", $tmp)."\n";
|
||||||
}
|
}
|
||||||
$this->js("navigator.clipboard.writeText(`$copystring`)");
|
$this->js("navigator.clipboard.writeText(`$copystring`)");
|
||||||
}
|
}
|
||||||
@@ -465,6 +459,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
$this->sourceRecords[$k]['tsh'] = '';
|
$this->sourceRecords[$k]['tsh'] = '';
|
||||||
$this->sourceRecords[$k]['crd'] = '';
|
$this->sourceRecords[$k]['crd'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Calcolare Aspettativa Team per GOALS
|
// Calcolare Aspettativa Team per GOALS
|
||||||
@@ -479,28 +474,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
$asp_team = $res->exp_away;
|
$asp_team = $res->exp_away;
|
||||||
}
|
}
|
||||||
|
|
||||||
// "atr" => 2.8868026211843
|
$player = StatistikoDetail::where('ss_team_id', (int) $team_id)->where('pos', '!=', 'GK')->where('is_active', 1)->get();
|
||||||
// "id" => 44691
|
|
||||||
// "name" => "Maicon"
|
|
||||||
// "on_field" => 0
|
|
||||||
// "position" => "DC"
|
|
||||||
// "sgf" => 1044
|
|
||||||
// "smg" => 1044
|
|
||||||
// "adg" => 90
|
|
||||||
// "as_goals" => 0.044
|
|
||||||
// "at_goals" => 67.511
|
|
||||||
// "as_cards" => 0.195
|
|
||||||
// "at_cards" => 67.54875
|
|
||||||
// "as_fouls" => 0.959
|
|
||||||
// "at_fouls" => 67.73975
|
|
||||||
// "as_offsides" => 0.036
|
|
||||||
// "at_offsides" => 67.509
|
|
||||||
// "as_total_shots" => 0.525
|
|
||||||
// "at_total_shots" => 67.63125
|
|
||||||
// "as_shots_on_target" => 0.263
|
|
||||||
// "at_shots_on_target" => 67.56575
|
|
||||||
|
|
||||||
$player = StatistikoDetail::where('ss_team_id', (int) $team_id)->where('position', '!=', 'GK')->where('is_active', 1)->get();
|
|
||||||
|
|
||||||
// Aspettativa Team di Riferimento
|
// Aspettativa Team di Riferimento
|
||||||
// (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10.
|
// (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10.
|
||||||
@@ -531,7 +505,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
} else {
|
} else {
|
||||||
$tmp['active'] = 0;
|
$tmp['active'] = 0;
|
||||||
}
|
}
|
||||||
$tmp['position'] = $position;
|
$tmp['pos'] = $position;
|
||||||
|
|
||||||
// Aspettativa di Gioco (AdG) = Somma Goals fatti da Player nel DB / Somma Minuti Giocati da Player (SMG) nel DB * 90.
|
// Aspettativa di Gioco (AdG) = Somma Goals fatti da Player nel DB / Somma Minuti Giocati da Player (SMG) nel DB * 90.
|
||||||
// Se la SMG è < Y per quel Player prenderemo in considerazione solo l'Aspettativa Statistica (AS).
|
// Se la SMG è < Y per quel Player prenderemo in considerazione solo l'Aspettativa Statistica (AS).
|
||||||
@@ -555,18 +529,18 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
|
|
||||||
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
||||||
foreach ($bettypes as $bettype) {
|
foreach ($bettypes as $bettype) {
|
||||||
$asp_statistica = (float) SofaScorePlayerPosition::where('ss_code', $position)->value('exp_' . $bettype);
|
$asp_statistica = (float) SofaScorePlayerPosition::where('ss_code', $position)->value('exp_'.$bettype);
|
||||||
$tmp['asp_statistica_' . $bettype] = $asp_statistica;
|
$tmp['asp_statistica_'.$bettype] = $asp_statistica;
|
||||||
|
|
||||||
if ($somma_minuti < $this->y_value) {
|
if ($somma_minuti < $this->y_value) {
|
||||||
// Se la SMG è < Y per quel Player prenderemo in considerazione solo l'Aspettativa Statistica (AS).
|
// Se la SMG è < Y per quel Player prenderemo in considerazione solo l'Aspettativa Statistica (AS).
|
||||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||||
} else {
|
} else {
|
||||||
// Aspettativa Teorica (AT) Goals = (X * AdG + AS) / (1 + X)
|
// Aspettativa Teorica (AT) Goals = (X * AdG + AS) / (1 + X)
|
||||||
// dove X è un valore che dovrebbe essere parametrizzabile da una interfaccia.
|
// dove X è un valore che dovrebbe essere parametrizzabile da una interfaccia.
|
||||||
// Il valore iniziale lo fissiamo a X = 3
|
// Il valore iniziale lo fissiamo a X = 3
|
||||||
// (AT)
|
// (AT)
|
||||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -580,11 +554,11 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
|
|
||||||
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
||||||
foreach ($bettypes as $bettype) {
|
foreach ($bettypes as $bettype) {
|
||||||
$total_bettype = array_sum(array_column($results, 'asp_teorica_' . $bettype));
|
$total_bettype = array_sum(array_column($results, 'asp_teorica_'.$bettype));
|
||||||
foreach ($results as $key => $value) {
|
foreach ($results as $key => $value) {
|
||||||
// Aspettativa per Player: AP = AT * ATR / TOT AT
|
// Aspettativa per Player: AP = AT * ATR / TOT AT
|
||||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||||
$results[$key]['asp_player_' . $bettype] = ((float) $value['asp_team'] * (float) $value['asp_teorica_' . $bettype]) / $total_bettype;
|
$results[$key]['asp_player_'.$bettype] = ((float) $value['asp_team'] * (float) $value['asp_teorica_'.$bettype]) / $total_bettype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,23 +566,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
|
|
||||||
// update frontend
|
// update frontend
|
||||||
foreach ($this->sourceRecords as $k => $record) {
|
foreach ($this->sourceRecords as $k => $record) {
|
||||||
// "id" => 787607
|
|
||||||
// "name" => "Keno"
|
|
||||||
// "preferred_foot" => "Right"
|
|
||||||
// "player_position" => "LW"
|
|
||||||
// "position_area" => "attack"
|
|
||||||
// "player_color" => "warning"
|
|
||||||
// "timed_color" => "danger"
|
|
||||||
// "events_played" => 7
|
|
||||||
// "everage_minutes" => 11
|
|
||||||
// "position" => "DC"
|
|
||||||
// "active" => 1
|
|
||||||
// "gls" => 0
|
|
||||||
// "fls" => 0
|
|
||||||
// "ofs" => 0
|
|
||||||
// "snt" => 0
|
|
||||||
// "tsh" => 0
|
|
||||||
// "crd" => 0
|
|
||||||
foreach ($results as $key => $result) {
|
foreach ($results as $key => $result) {
|
||||||
// "id" => 44691
|
// "id" => 44691
|
||||||
// "name" => "Maicon"
|
// "name" => "Maicon"
|
||||||
@@ -656,7 +614,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
|
|||||||
// see if player is in field and if yes get new position
|
// see if player is in field and if yes get new position
|
||||||
foreach ($this->sourceRecords as $record) {
|
foreach ($this->sourceRecords as $record) {
|
||||||
if ($record['id'] == $ss_player_id) {
|
if ($record['id'] == $ss_player_id) {
|
||||||
return $record['position'];
|
return $record['pos'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Livewire;
|
namespace App\Livewire;
|
||||||
|
|
||||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
|
||||||
use App\Filament\Pages\Selections\LoadPositions;
|
use App\Filament\Pages\Selections\LoadPositions;
|
||||||
use App\Models\SofaScorePlayerPerSeason;
|
use App\Models\SofaScorePlayerPerSeason;
|
||||||
use App\Models\StatistikoEvent;
|
|
||||||
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
@@ -22,129 +20,64 @@ class PlayerCalculator extends Component
|
|||||||
|
|
||||||
public static function load(array $filters)
|
public static function load(array $filters)
|
||||||
{
|
{
|
||||||
$team_position = $filters['team_position'];
|
|
||||||
$season = $filters['season'];
|
|
||||||
$seasonmode = $filters['seasonmode'];
|
|
||||||
$team_id = (int) $filters['team_id'];
|
$team_id = (int) $filters['team_id'];
|
||||||
$season = GetSeason::load($season, $seasonmode);
|
|
||||||
|
|
||||||
$matches = StatistikoEvent::whereIn('season', $season)
|
|
||||||
->where(function ($query) use ($team_id, $team_position) {
|
|
||||||
switch ($team_position) {
|
|
||||||
case 'home':
|
|
||||||
return $query->where('home_id', $team_id);
|
|
||||||
case 'away':
|
|
||||||
return $query->where('away_id', $team_id);
|
|
||||||
default:
|
|
||||||
return $query->where('home_id', $team_id)
|
|
||||||
->orWhere('away_id', $team_id);
|
|
||||||
}
|
|
||||||
})->pluck('match_id');
|
|
||||||
|
|
||||||
$positions_map = LoadPositions::load();
|
$positions_map = LoadPositions::load();
|
||||||
|
|
||||||
$player = SofaScorePlayerPerSeason::with('details')->where('ss_team_id', $team_id)->whereIn('season', $season)->get();
|
$player = SofaScorePlayerPerSeason::with('details')->where('season', '=', 'total')->where('ss_team_id', '=', $team_id)->get();
|
||||||
|
|
||||||
$arr = [];
|
|
||||||
foreach ($player as $val) {
|
|
||||||
if ($val->details && $val->details->is_active) {
|
|
||||||
$player_id = $val->ss_player_id;
|
|
||||||
if (! isset($arr[$player_id])) {
|
|
||||||
$arr[$player_id]['player_name'] = $val->details->player_name;
|
|
||||||
$arr[$player_id]['events_played_home'] = $val->events_played_home;
|
|
||||||
$arr[$player_id]['events_played_away'] = $val->events_played_away;
|
|
||||||
$arr[$player_id]['minutes_played_home'] = $val->minutes_played_home;
|
|
||||||
$arr[$player_id]['minutes_played_away'] = $val->minutes_played_away;
|
|
||||||
$arr[$player_id]['preferred_foot'] = $val->details->preferred_foot ?? '';
|
|
||||||
$arr[$player_id]['player_position'] = $val->details->position ?? '';
|
|
||||||
$arr[$player_id]['color_level'] = round($matches->count() / 3);
|
|
||||||
} else {
|
|
||||||
$arr[$player_id]['events_played_home'] += $val->events_played_home;
|
|
||||||
$arr[$player_id]['events_played_away'] += $val->events_played_away;
|
|
||||||
$arr[$player_id]['minutes_played_home'] += $val->minutes_played_home;
|
|
||||||
$arr[$player_id]['minutes_played_away'] += $val->minutes_played_away;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($arr as $player_id => $val) {
|
foreach ($player as $val) {
|
||||||
|
$tmp = [];
|
||||||
|
$tmp['id'] = $val->ss_player_id;
|
||||||
|
$tmp['name'] = $val->details->player_name;
|
||||||
|
$tmp['pos_ori'] = $val->details->position;
|
||||||
|
$tmp['pos'] = '';
|
||||||
|
$tmp['foot'] = $val->details->preferred_foot;
|
||||||
|
$tmp['tot_evt'] = $val->total_events;
|
||||||
|
$tmp['tot_min'] = $val->total_min;
|
||||||
|
$tmp['ave_min'] = $val->average_min;
|
||||||
|
$tmp['gls'] = $val->goals;
|
||||||
|
$tmp['fls'] = $val->fouls;
|
||||||
|
$tmp['ofs'] = $val->offsides;
|
||||||
|
$tmp['crd'] = $val->cards;
|
||||||
|
$tmp['snt'] = $val->shots_on_target;
|
||||||
|
$tmp['tsh'] = $val->shots_off_target;
|
||||||
|
|
||||||
switch ($team_position) {
|
$level = round($val->total_events / 3);
|
||||||
case 'home':
|
if ($val->total_events) {
|
||||||
$events_played = $val['events_played_home'];
|
if ($level > 1 && $val->total_events < $level) {
|
||||||
$minues_played = $val['minutes_played_home'];
|
$tmp['color_evt'] = 'danger';
|
||||||
break;
|
} elseif ($val->total_events < $level * 2) {
|
||||||
case 'away':
|
$tmp['color_evt'] = 'info';
|
||||||
$events_played = $val['events_played_away'];
|
|
||||||
$minues_played = $val['minutes_played_away'];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$events_played = $val['events_played_home'] + $val['events_played_away'];
|
|
||||||
$minues_played = $val['minutes_played_home'] + $val['minutes_played_home'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$colorlevel = round($matches->count() / 3);
|
|
||||||
|
|
||||||
if (in_array($val['player_position'], $positions_map['MIDFIELD'])) {
|
|
||||||
$player_position = $val['player_position'];
|
|
||||||
$position_area = 'midfield';
|
|
||||||
$player_color = 'info';
|
|
||||||
} elseif (in_array($val['player_position'], $positions_map['DEFENCE'])) {
|
|
||||||
$player_position = $val['player_position'];
|
|
||||||
$position_area = 'defence';
|
|
||||||
$player_color = 'success';
|
|
||||||
} elseif (in_array($val['player_position'], $positions_map['ATTACK'])) {
|
|
||||||
$player_position = $val['player_position'];
|
|
||||||
$position_area = 'attack';
|
|
||||||
$player_color = 'warning';
|
|
||||||
} elseif (in_array($val['player_position'], $positions_map['GOALKEEPER'])) {
|
|
||||||
$player_position = $val['player_position'];
|
|
||||||
$position_area = 'goalkeeper';
|
|
||||||
$player_color = 'gray';
|
|
||||||
} else {
|
|
||||||
$player_position = 'NO SPECIFIC POSITION';
|
|
||||||
$position_area = 'non';
|
|
||||||
$player_color = 'danger';
|
|
||||||
}
|
|
||||||
|
|
||||||
$everage_minutes = 0;
|
|
||||||
$timed_color = '';
|
|
||||||
if ($events_played) {
|
|
||||||
$everage_minutes = round($minues_played / $events_played);
|
|
||||||
if ($colorlevel > 1 && $events_played < $colorlevel) {
|
|
||||||
$timed_color = 'danger';
|
|
||||||
} elseif ($events_played < $colorlevel * 2) {
|
|
||||||
$timed_color = 'info';
|
|
||||||
} else {
|
} else {
|
||||||
$timed_color = 'success';
|
$tmp['color_evt'] = 'success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result[] = [
|
if (in_array($val->details->position, $positions_map['MIDFIELD'])) {
|
||||||
'id' => $player_id,
|
$tmp['area'] = 'midfield';
|
||||||
'name' => $val['player_name'],
|
$tmp['color_pos'] = 'info';
|
||||||
'preferred_foot' => $val['preferred_foot'],
|
} elseif (in_array($val->details->position, $positions_map['DEFENCE'])) {
|
||||||
'player_position' => $player_position,
|
$tmp['area'] = 'defence';
|
||||||
'position_area' => $position_area,
|
$tmp['color_pos'] = 'success';
|
||||||
'player_color' => $player_color,
|
} elseif (in_array($val->details->position, $positions_map['ATTACK'])) {
|
||||||
'timed_color' => $timed_color,
|
$tmp['area'] = 'attack';
|
||||||
'events_played' => $events_played,
|
$tmp['color_pos'] = 'warning';
|
||||||
'everage_minutes' => $everage_minutes,
|
} elseif (in_array($val->details->position, $positions_map['GOALKEEPER'])) {
|
||||||
'position' => '',
|
$tmp['area'] = 'goalkeeper';
|
||||||
'active' => 0,
|
$tmp['color_pos'] = 'gray';
|
||||||
'gls' => 0,
|
} else {
|
||||||
'fls' => 0,
|
$tmp['area'] = 'defence';
|
||||||
'ofs' => 0,
|
$tmp['color_pos'] = 'success';
|
||||||
'snt' => 0,
|
}
|
||||||
'tsh' => 0,
|
|
||||||
'crd' => 0,
|
$result[] = $tmp;
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$pos = array_column($result, 'player_position');
|
$pos = array_column($result, 'pos');
|
||||||
$area = array_column($result, 'position_area');
|
$area = array_column($result, 'area');
|
||||||
|
|
||||||
array_multisort($area, SORT_ASC, $pos, SORT_ASC, $result);
|
array_multisort($area, SORT_ASC, $pos, SORT_ASC, $result);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class SofaScorePlayerPerSeason extends Model
|
class SofaScorePlayerPerSeason extends Model
|
||||||
{
|
{
|
||||||
|
protected $table = 'ss_player_seasons';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'ss_player_id',
|
'ss_player_id',
|
||||||
'ss_team_id',
|
'ss_team_id',
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ trait UpdateHelper
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function startBenchmark(string $table = 'sofa_score_player_per_seasons'): void
|
protected function startBenchmark(string $table = 'ss_player_seasons'): void
|
||||||
{
|
{
|
||||||
$this->startRowCount = DB::table($table)->count();
|
$this->startRowCount = DB::table($table)->count();
|
||||||
$this->benchmarkStartTime = microtime(true);
|
$this->benchmarkStartTime = microtime(true);
|
||||||
@@ -89,7 +89,7 @@ trait UpdateHelper
|
|||||||
$this->startQueries = DB::select("SHOW SESSION STATUS LIKE 'Questions'")[0]->Value;
|
$this->startQueries = DB::select("SHOW SESSION STATUS LIKE 'Questions'")[0]->Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function endBenchmark(string $table = 'sofa_score_player_per_seasons'): void
|
protected function endBenchmark(string $table = 'ss_player_seasons'): void
|
||||||
{
|
{
|
||||||
$executionTime = microtime(true) - $this->benchmarkStartTime;
|
$executionTime = microtime(true) - $this->benchmarkStartTime;
|
||||||
$memoryUsage = round((memory_get_usage() - $this->benchmarkStartMemory) / 1024 / 1024, 2);
|
$memoryUsage = round((memory_get_usage() - $this->benchmarkStartMemory) / 1024 / 1024, 2);
|
||||||
@@ -195,14 +195,15 @@ trait UpdateHelper
|
|||||||
$collection_1d[] = $row;
|
$collection_1d[] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SofaScorePlayerPerSeason::upsert(
|
SofaScorePlayerPerSeason::upsert(
|
||||||
$collection_1d,
|
$collection_1d,
|
||||||
[
|
uniqueBy: [
|
||||||
'ss_player_id',
|
'ss_player_id',
|
||||||
'ss_team_id',
|
'ss_team_id',
|
||||||
'season',
|
'season',
|
||||||
],
|
],
|
||||||
[
|
update: [
|
||||||
'total_events',
|
'total_events',
|
||||||
'total_min',
|
'total_min',
|
||||||
'average_min',
|
'average_min',
|
||||||
|
|||||||
+6
-5
@@ -11,11 +11,11 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('sofa_score_player_per_seasons', function (Blueprint $table) {
|
Schema::create('ss_player_seasons', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->integer('ss_player_id')->index();
|
$table->integer('ss_player_id')->index()->default(0);
|
||||||
$table->integer('ss_team_id')->index();
|
$table->integer('ss_team_id')->index()->default(0);
|
||||||
$table->string('season')->index();
|
$table->string('season')->index()->default('');
|
||||||
$table->integer('total_events')->default(0)->nullable();
|
$table->integer('total_events')->default(0)->nullable();
|
||||||
$table->integer('total_min')->default(0)->nullable();
|
$table->integer('total_min')->default(0)->nullable();
|
||||||
$table->integer('average_min')->default(0)->nullable();
|
$table->integer('average_min')->default(0)->nullable();
|
||||||
@@ -29,6 +29,7 @@ return new class extends Migration
|
|||||||
$table->integer('offsides')->default(0)->nullable();
|
$table->integer('offsides')->default(0)->nullable();
|
||||||
$table->integer('shots_on_target')->default(0)->nullable();
|
$table->integer('shots_on_target')->default(0)->nullable();
|
||||||
$table->integer('shots_off_target')->default(0)->nullable();
|
$table->integer('shots_off_target')->default(0)->nullable();
|
||||||
|
$table->unique(['ss_player_id', 'ss_team_id', 'season']);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -38,6 +39,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('sofa_score_player_per_seasons');
|
Schema::dropIfExists('ss_player_seasons');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,24 @@
|
|||||||
@php
|
@php
|
||||||
$record = $getRecord();
|
$record = $getRecord();
|
||||||
|
/***
|
||||||
|
"id" => 1218016
|
||||||
|
"name" => "Walter Nuñez"
|
||||||
|
"pos_ori" => "LW"
|
||||||
|
"pos" => "LW"
|
||||||
|
"foot" => "Right"
|
||||||
|
"tot_evt" => 2
|
||||||
|
"tot_min" => 102
|
||||||
|
"ave_min" => 51
|
||||||
|
"gls" => 0
|
||||||
|
"fls" => 3
|
||||||
|
"ofs" => 0
|
||||||
|
"crd" => 0
|
||||||
|
"snt" => 0
|
||||||
|
"tsh" => 0
|
||||||
|
"color_evt" => "success"
|
||||||
|
"area" => "attack"
|
||||||
|
"color_pos" => "warning"
|
||||||
|
*/
|
||||||
@endphp
|
@endphp
|
||||||
@if ($record['active'])
|
@if ($record['active'])
|
||||||
<div draggable="false"
|
<div draggable="false"
|
||||||
@@ -8,17 +27,17 @@
|
|||||||
<div>{{ $record['gls'] }}</div>
|
<div>{{ $record['gls'] }}</div>
|
||||||
<div>{{ $record['fls'] }}</div>
|
<div>{{ $record['fls'] }}</div>
|
||||||
<div>{{ $record['ofs'] }}</div>
|
<div>{{ $record['ofs'] }}</div>
|
||||||
|
<div>{{ $record['crd'] }}</div>
|
||||||
<div>{{ $record['snt'] }}</div>
|
<div>{{ $record['snt'] }}</div>
|
||||||
<div>{{ $record['tsh'] }}</div>
|
<div>{{ $record['tsh'] }}</div>
|
||||||
<div>{{ $record['crd'] }}</div>
|
<div>{{ $record['foot'] }}</div>
|
||||||
<div>{{ $record['preferred_foot'] }}</div>
|
<div>{{ $record['tot_evt'] }}</div>
|
||||||
<div>{{ $record['events_played'] }}</div>
|
<div>{{ $record['ave_min'] }}</div>
|
||||||
<div>{{ $record['everage_minutes'] }}</div>
|
<div class="bg-black text-white rounded font-bold">{{ $record['pos'] }}</div>
|
||||||
<div class="bg-black text-white rounded font-bold">{{ $record['position'] }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="w-18 font-stretch-ultra-condensed">
|
<div class="w-18 font-stretch-ultra-condensed">
|
||||||
<x-filament::badge size="sm" color="{{ $record['player_color'] }}">
|
<x-filament::badge size="sm" color="{{ $record['color_pos'] }}">
|
||||||
{{ ucfirst($record['player_position']) }}
|
{{ ucfirst($record['pos_ori']) }}
|
||||||
</x-filament::badge>
|
</x-filament::badge>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-left text-sm tracking-tight flex-1 text-red-500">
|
<div class="text-left text-sm tracking-tight flex-1 text-red-500">
|
||||||
@@ -41,14 +60,14 @@
|
|||||||
<div>{{ $record['snt'] }}</div>
|
<div>{{ $record['snt'] }}</div>
|
||||||
<div>{{ $record['tsh'] }}</div>
|
<div>{{ $record['tsh'] }}</div>
|
||||||
<div>{{ $record['crd'] }}</div>
|
<div>{{ $record['crd'] }}</div>
|
||||||
<div>{{ $record['preferred_foot'] }}</div>
|
<div>{{ $record['foot'] }}</div>
|
||||||
<div>{{ $record['events_played'] }}</div>
|
<div>{{ $record['tot_evt'] }}</div>
|
||||||
<div>{{ $record['everage_minutes'] }}</div>
|
<div>{{ $record['ave_min'] }}</div>
|
||||||
<div class="bg-black text-white rounded font-bold">{{ $record['position'] }}</div>
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-18 font-stretch-ultra-condensed">
|
<div class="w-18 font-stretch-ultra-condensed">
|
||||||
<x-filament::badge size="sm" color="{{ $record['player_color'] }}">
|
<x-filament::badge size="sm" color="{{ $record['color_pos'] }}">
|
||||||
{{ ucfirst($record['player_position']) }}
|
{{ ucfirst($record['pos_ori']) }}
|
||||||
</x-filament::badge>
|
</x-filament::badge>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-left text-sm tracking-tight flex-1">
|
<div class="text-left text-sm tracking-tight flex-1">
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
|
{{--
|
||||||
|
"id" => 1218016
|
||||||
|
"name" => "Walter Nuñez"
|
||||||
|
"pos" => "LW"
|
||||||
|
"foot" => "Right"
|
||||||
|
"tot_evt" => 2
|
||||||
|
"tot_min" => 102
|
||||||
|
"ave_min" => 51
|
||||||
|
"gls" => 0
|
||||||
|
"fls" => 3
|
||||||
|
"ofs" => 0
|
||||||
|
"crd" => 0
|
||||||
|
"snt" => 0
|
||||||
|
"tsh" => 0
|
||||||
|
"color_evt" => "success"
|
||||||
|
"area" => "attack"
|
||||||
|
"color_pos" => "warning"
|
||||||
|
--}}
|
||||||
<div class="relative w-full">
|
<div class="relative w-full">
|
||||||
<div class="fixed left-0 top-0 h-screen dispatcher-board-root w-146 max-w-146 overflow-y-auto no-scrollbar">
|
<div class="fixed left-0 top-0 h-screen dispatcher-board-root w-146 max-w-146 overflow-y-auto no-scrollbar">
|
||||||
{{ $this->table }}
|
{{ $this->table }}
|
||||||
</div>
|
</div>
|
||||||
<div class="fixed left-147 top-5 right-0 bottom-0 h-screen max-w-4xl">
|
<div class="fixed left-147 top-5 right-0 bottom-0 h-screen max-w-4xl">
|
||||||
<div>
|
<div>
|
||||||
<div class="font-black text-2xl text-center">{{ $ss_team_name }}</div>
|
<div class="font-black text-2xl text-center">{{ $team_name }}</div>
|
||||||
<div class="grid grid-cols-4 items-center">
|
<div class="grid grid-cols-4 items-center">
|
||||||
<div class="m-4 col-span-2">{{ $this->form }}</div>
|
<div class="m-4 col-span-2">{{ $this->form }}</div>
|
||||||
<div class="text-center pt-4">Player on field: {{ $player_on_field_counter }}</div>
|
<div class="text-center pt-4">Player on field: {{ $player_on_field_counter }}</div>
|
||||||
@@ -40,11 +58,13 @@
|
|||||||
}
|
}
|
||||||
"
|
"
|
||||||
:class="isOver ? 'border-red-500 bg-white/20 ring-2 ring-red-500/50 scale-[1.02]' :
|
:class="isOver ? 'border-red-500 bg-white/20 ring-2 ring-red-500/50 scale-[1.02]' :
|
||||||
@if (in_array($benennung, ['SW', 'DR', 'DC', 'DL'])) 'border-gray-800 bg-green-500/40'
|
@if (in_array($benennung, ['SW', 'DR', 'DC', 'DL']))
|
||||||
|
'border-gray-800 bg-green-500/40'
|
||||||
@elseif (in_array($benennung, ['DM', 'MR', 'MC', 'ML', 'AM']))
|
@elseif (in_array($benennung, ['DM', 'MR', 'MC', 'ML', 'AM']))
|
||||||
'border-gray-800 bg-blue-500/40'
|
'border-gray-800 bg-blue-500/40'
|
||||||
@else
|
@else
|
||||||
'border-gray-800 bg-amber-500/40' @endif"
|
'border-gray-800 bg-amber-500/40'
|
||||||
|
@endif"
|
||||||
class="border-2 rounded-xl transition-all px-1 pt-0 flex flex-col justify-start transform inset-shadow-sm inset-shadow-white/50 shadow-lg">
|
class="border-2 rounded-xl transition-all px-1 pt-0 flex flex-col justify-start transform inset-shadow-sm inset-shadow-white/50 shadow-lg">
|
||||||
<!-- Box Header -->
|
<!-- Box Header -->
|
||||||
<div class="grid grid-cols-6 items-center">
|
<div class="grid grid-cols-6 items-center">
|
||||||
|
|||||||
Reference in new issue
Block a user