This commit is contained in:
salam committed 2026-06-18 18:58:29 +02:00
1 parent e94802334d
commit 6aefe4f0c2
2 files changed
+12 -10

No files matched your search

+6 -3
View File
@@ -45,16 +45,19 @@ class LoadPlayer
$arr = []; $arr = [];
foreach ($res_details as $val) { foreach ($res_details as $val) {
$tm_player_id = $val->tm_player_id; $tm_player_id = $val->tm_player_id;
$position = strtoupper($val->position);
$matches_played = isset($counting[$tm_player_id]) ? $counting[$tm_player_id] : 0; $matches_played = isset($counting[$tm_player_id]) ? $counting[$tm_player_id] : 0;
if($matches_played < $colorlevel){ if($matches_played < $colorlevel){
$arr[$val->position][$val->tm_player_id] = '<span class="text-red-600">'.$val->name.' ('.$matches_played.')</span>'; $arr[$position][$val->tm_player_id] = '<span class="text-red-600">'.$val->name.' ('.$matches_played.')</span>';
} }
else if($matches_played < $colorlevel*2){ else if($matches_played < $colorlevel*2){
$arr[$val->position][$val->tm_player_id] = '<span class="text-blue-500">'.$val->name.' ('.$matches_played.')</span>'; $arr[$position][$val->tm_player_id] = '<span class="text-blue-500">'.$val->name.' ('.$matches_played.')</span>';
} }
else { else {
$arr[$val->position][$val->tm_player_id] = '<span class="text-green-500">'.$val->name.' ('.$matches_played.')</span>'; $arr[$position][$val->tm_player_id] = '<span class="text-green-500">'.$val->name.' ('.$matches_played.')</span>';
} }
} }
+6 -7
View File
@@ -108,14 +108,13 @@ class Statistic extends BaseDashboard
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->options(function (Get $get) { ->options(function (Get $get) {
if ($get('match_id')) { if ($get('match_id')) {
$res = StatisticFixtures::where('id', $get('match_id'))->get(); $res = StatisticFixtures::where('id', $get('match_id'))->first();
$arr = [];
foreach ($res as $value) {
$arr[] = $value->home_id;
$arr[] = $value->away_id;
}
return Element::query()->whereIn('id', $arr)->pluck('name', 'id'); $arr = [];
$arr[$res->home_id] = Element::query()->where('id', $res->home_id)->value('name');
$arr[$res->away_id] = Element::query()->where('id', $res->away_id)->value('name');
return $arr;
} }
}) })
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {