This commit is contained in:
salam committed 2026-07-27 16:53:00 +02:00
1 parent 5a6d3585e5
commit 6e14dbd1bc
11 files changed
+123 -67

No files matched your search

@@ -21,7 +21,7 @@ class StatisticFixturesTable
->columns([
IconColumn::make('sport_id')
->label('')
->icon(fn (string $state): string => match ($state) {
->icon(fn(string $state): string => match ($state) {
'1' => 'icon-soccerball',
'2' => 'icon-icehockey',
'3' => 'icon-basketball',
@@ -31,16 +31,16 @@ class StatisticFixturesTable
->label('League')
->searchable()
->wrap()
->tooltip(fn ($record) => $record->league_id)
->hidden(fn () => auth()->user()->sport_id == 5)
->description(fn ($record) => ucwords($record->league?->country->name)),
TextColumn::make('starttime')->dateTime('M j, Y h:i')->label('Date'),
->tooltip(fn($record) => $record->league_id)
->hidden(fn() => auth()->user()->sport_id == 5)
->description(fn($record) => ucwords($record->league?->country->name)),
TextColumn::make('starttime')->dateTime('Y-m-d H:i'),
TextColumn::make('home.name')
->tooltip(fn ($record) => $record->home_id)
->tooltip(fn($record) => $record->home_id)
->color('primary')
->searchable(),
TextColumn::make('away.name')
->tooltip(fn ($record) => $record->away_id)
->tooltip(fn($record) => $record->away_id)
->color('success')
->searchable(),
// TextColumn::make('exp_home')->alignCenter()->numeric(),
@@ -49,7 +49,7 @@ class StatisticFixturesTable
])
->filters([
SelectFilter::make('league_id')
->options(fn () => LoadStatisticFixturesLeaguesOptions::load(1))
->options(fn() => LoadStatisticFixturesLeaguesOptions::load(1))
->preload()
->searchable()
->columnSpan(2)
@@ -50,7 +50,7 @@ class StatistikoEventsTable
->copyable()
->copyMessage('Away team name copied')
->copyMessageDuration(1500),
TextColumn::make('starttime')->dateTime('d.m.Y H:i'),
TextColumn::make('starttime')->dateTime('Y-m-d H:i'),
])
->filters([
-1
View File
@@ -63,7 +63,6 @@ class ChartEvent extends ChartWidget
position: 'left',
generateLabels: (chart) => {
const datasets = chart.data.datasets;
alert(datasets)
},
},
tooltip: {
+1 -6
View File
@@ -203,13 +203,8 @@ class LoadEvents
foreach ($res as $value) {
// dd($value);
$result_code = (string) $value['result_code'];
Log::debug($value);
$labels[] = round($value['starttime']->diffInDays(Carbon::now()));
// $labels[] = $value['starttime']->format('Y-m-d H:i');
$playing_date[] = $value['starttime']->format('d. F Y H:i');
+44 -28
View File
@@ -502,46 +502,62 @@ class LoadPerformance
$count_home = 0;
$count_away = 0;
for ($i = \count($homes['all']) - 1; $i > 0; $i--) {
if ($homes['all'][$i] == null) {
$count_home++;
} else {
break;
if (isset($homes['all'])) {
for ($i = \count($homes['all']) - 1; $i > 0; $i--) {
if ($homes['all'][$i] == null) {
$count_home++;
} else {
break;
}
}
}
for ($i = \count($aways['all']) - 1; $i > 0; $i--) {
if ($aways['all'][$i] == null) {
$count_away++;
} else {
break;
if (isset($aways['all'])) {
for ($i = \count($aways['all']) - 1; $i > 0; $i--) {
if ($aways['all'][$i] == null) {
$count_away++;
} else {
break;
}
}
}
$keeps = count($homes['all']) - min($count_home, $count_away) - 1;
$homes['all'] = array_slice($homes['all'], 0, $keeps);
$homes['def'] = array_slice($homes['def'], 0, $keeps);
$homes['att'] = array_slice($homes['att'], 0, $keeps);
$homes['mid'] = array_slice($homes['mid'], 0, $keeps);
$aways['all'] = array_slice($aways['all'], 0, $keeps);
$aways['def'] = array_slice($aways['def'], 0, $keeps);
$aways['att'] = array_slice($aways['att'], 0, $keeps);
$aways['mid'] = array_slice($aways['mid'], 0, $keeps);
if (isset($homes['all'])) {
$homes['all'] = array_slice($homes['all'], 0, $keeps);
$homes['def'] = array_slice($homes['def'], 0, $keeps);
$homes['att'] = array_slice($homes['att'], 0, $keeps);
$homes['mid'] = array_slice($homes['mid'], 0, $keeps);
}
if (isset($aways['all'])) {
$aways['all'] = array_slice($aways['all'], 0, $keeps);
$aways['def'] = array_slice($aways['def'], 0, $keeps);
$aways['att'] = array_slice($aways['att'], 0, $keeps);
$aways['mid'] = array_slice($aways['mid'], 0, $keeps);
}
// $labels = array_slice($labels, 0, $keeps);
$labels = range(1, $keeps);
}
public static function makeAv(array &$arr, $length)
public static function makeAv(array &$arr, int $length)
{
$all = isset($arr['all']) ? array_sum($arr['all']) / count($arr['all']) : 1;
$def = isset($arr['def']) ? array_sum($arr['def']) / count($arr['def']) : 1;
$mid = isset($arr['mid']) ? array_sum($arr['mid']) / count($arr['mid']) : 1;
$att = isset($arr['att']) ? array_sum($arr['att']) / count($arr['att']) : 1;
$ret = [];
$ret['all'] = array_fill(0, $length, round($all, 2));
$ret['def'] = array_fill(0, $length, round($def, 2));
$ret['mid'] = array_fill(0, $length, round($mid, 2));
$ret['att'] = array_fill(0, $length, round($att, 2));
if (isset($arr['all']) && count($arr['all'])) {
$all = isset($arr['all']) ? array_sum($arr['all']) / count($arr['all']) : 1;
$def = isset($arr['def']) ? array_sum($arr['def']) / count($arr['def']) : 1;
$mid = isset($arr['mid']) ? array_sum($arr['mid']) / count($arr['mid']) : 1;
$att = isset($arr['att']) ? array_sum($arr['att']) / count($arr['att']) : 1;
$ret = [];
$ret['all'] = array_fill(0, $length, round($all, 2));
$ret['def'] = array_fill(0, $length, round($def, 2));
$ret['mid'] = array_fill(0, $length, round($mid, 2));
$ret['att'] = array_fill(0, $length, round($att, 2));
} else {
$ret = [];
$ret['all'] = [];
$ret['def'] = [];
$ret['mid'] = [];
$ret['att'] = [];
}
return $ret;
}