pips decimal at slider

This commit is contained in:
salam committed 2026-06-03 15:54:18 +02:00
1 parent 10801ddab2
commit 99363e001c
5 files changed
+2083 -33

No files matched your search

+13 -16
View File
@@ -33,7 +33,7 @@ class StatsMedianAverage extends StatsOverviewWidget
'default' => 1,
'sm' => 2,
'md' => 3,
'md' => 6,
'lg' => 6,
];
$statistic_type = ucfirst(HelperStatisticType::get($this->filters));
@@ -63,7 +63,6 @@ class StatsMedianAverage extends StatsOverviewWidget
Stat::make('stat1', 'stat1')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Number of events',
'value' => '0',
'hidden' => false,
]),
Stat::make('stat2', 'stat2')->view('filament.resources.events.widgets.statistic-average', [
'titel' => 'Average '.$statistic_type,
@@ -82,17 +81,14 @@ class StatsMedianAverage extends StatsOverviewWidget
Stat::make('stat4', 'stat4')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Win',
'value' => 0,
'hidden' => false,
]),
Stat::make('stat5', 'stat5')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Draw',
'value' => 0,
'hidden' => false,
]),
Stat::make('stat6', 'stat6')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Lost',
'value' => 0,
'hidden' => false,
]),
];
}
@@ -122,15 +118,20 @@ class StatsMedianAverage extends StatsOverviewWidget
$median_away = $arr_away[$m];
}
$win = $data['results']['w'] ? number_format(Round::odd($total_home / $data['results']['w']), 2) : 0;
$draw = $data['results']['d'] ? number_format(Round::odd($total_home / $data['results']['d']), 2) : 0;
$lost = $data['results']['l'] ? number_format(Round::odd($total_home / $data['results']['l']), 2) : 0;
if ($data['similar_past_matches'] == 'none') {
$win = $data['results']['w'] ? number_format(Round::odd($total_home / $data['results']['w']), 2) : 0;
$draw = $data['results']['d'] ? number_format(Round::odd($total_home / $data['results']['d']), 2) : 0;
$lost = $data['results']['l'] ? number_format(Round::odd($total_home / $data['results']['l']), 2) : 0;
} else {
$win = 0;
$draw = 0;
$lost = 0;
}
return [
Stat::make('stat1', 'stat1')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Number of events',
'value' => $total_home,
'hidden' => false,
]),
Stat::make('stat2', 'stat2')->view('filament.resources.events.widgets.statistic-average', [
'titel' => 'Average '.$statistic_type,
@@ -146,21 +147,17 @@ class StatsMedianAverage extends StatsOverviewWidget
'home' => $home_team,
'away' => $away_team,
]),
Stat::make('stat4', 'stat4')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Win: '.$data['results']['w'],
'titel' => ($data['similar_past_matches'] != 'none') ? 'Win' : 'Win: '.$data['results']['w'],
'value' => $win,
'hidden' => $data['similar_past_matches'] == 'none' ? false : true,
]),
Stat::make('stat5', 'stat5')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Draw: '.$data['results']['d'],
'titel' => ($data['similar_past_matches'] != 'none') ? 'Draw' : 'Draw: '.$data['results']['d'],
'value' => $draw,
'hidden' => $data['similar_past_matches'] == 'none' ? false : true,
]),
Stat::make('stat6', 'stat6')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Lost: '.$data['results']['l'],
'titel' => ($data['similar_past_matches'] != 'none') ? 'Lost' : 'Lost: '.$data['results']['l'],
'value' => $lost,
'hidden' => $data['similar_past_matches'] == 'none' ? false : true,
]),
];
}