wip
This commit is contained in:
1 parent
e94802334d
commit
6aefe4f0c2
2 files changed
+12
-10
No files matched your search
@@ -40,21 +40,24 @@ class LoadPlayer
|
|||||||
if (! $counting) {
|
if (! $counting) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$colorlevel = round(max($counting)/3);
|
$colorlevel = round(max($counting)/3);
|
||||||
|
|
||||||
$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>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = [];
|
$arr = [];
|
||||||
foreach ($res as $value) {
|
$arr[$res->home_id] = Element::query()->where('id', $res->home_id)->value('name');
|
||||||
$arr[] = $value->home_id;
|
$arr[$res->away_id] = Element::query()->where('id', $res->away_id)->value('name');
|
||||||
$arr[] = $value->away_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Element::query()->whereIn('id', $arr)->pluck('name', 'id');
|
return $arr;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
|||||||
Reference in new issue
Block a user