This commit is contained in:
salam committed 2026-09-15 10:31:45 +02:00
1 parent 13ca0d7293
commit 6ad6ff23a9
3 files changed
+106 -104

No files matched your search

+1 -1
View File
@@ -349,7 +349,7 @@ class PlayerPropsDrop extends Widget
$count_player = 0;
foreach ($player_totals as $key => $value) {
if ($value->details->position != 'GK' && (int) $value->details->is_active != 0) {
if (isset($value->details) && $value->details->position != 'GK' && (int) $value->details->is_active != 0) {
$count_player++;
}
}
+51 -49
View File
@@ -16,64 +16,66 @@ class PlayerCalculator extends Component
$result = [];
foreach ($player as $val) {
if ($val->details && $val->details->is_active) {
$tmp = [];
$tmp['id'] = $val->ss_player_id;
if (! isset($val->details)) {
$tmp['name'] = $val->ss_player_id;
$tmp['pos_ori'] = 'GK';
$tmp['foot'] = 'Both';
} else {
$tmp['name'] = $val->details->player_name;
$tmp['pos_ori'] = $val->details->position;
$tmp['foot'] = $val->details->preferred_foot;
}
$tmp['pos'] = '';
$tmp['active'] = 0;
$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;
$level = round($val->total_events / 3);
if ($val->total_events) {
if ($level > 1 && $val->total_events < $level) {
$tmp['color_evt'] = 'danger';
} elseif ($val->total_events < $level * 2) {
$tmp['color_evt'] = 'info';
$tmp = [];
$tmp['id'] = $val->ss_player_id;
if (! isset($val->details)) {
$tmp['name'] = $val->ss_player_id;
$tmp['pos_ori'] = 'GK';
$tmp['foot'] = 'Both';
} else {
$tmp['color_evt'] = 'success';
$tmp['name'] = $val->details->player_name;
$tmp['pos_ori'] = $val->details->position;
$tmp['foot'] = $val->details->preferred_foot;
}
}
$tmp['pos'] = '';
$tmp['active'] = 0;
$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;
if (! isset($val->details)) {
$tmp['area'] = 'goalkeeper';
$tmp['color_pos'] = 'gray';
} else {
if (in_array($val->details->position, $positions_map['MIDFIELD'])) {
$tmp['area'] = 'midfield';
$tmp['color_pos'] = 'info';
} elseif (in_array($val->details->position, $positions_map['DEFENCE'])) {
$tmp['area'] = 'defence';
$tmp['color_pos'] = 'success';
} elseif (in_array($val->details->position, $positions_map['ATTACK'])) {
$tmp['area'] = 'attack';
$tmp['color_pos'] = 'warning';
} elseif (in_array($val->details->position, $positions_map['GOALKEEPER'])) {
$level = round($val->total_events / 3);
if ($val->total_events) {
if ($level > 1 && $val->total_events < $level) {
$tmp['color_evt'] = 'danger';
} elseif ($val->total_events < $level * 2) {
$tmp['color_evt'] = 'info';
} else {
$tmp['color_evt'] = 'success';
}
}
if (! isset($val->details)) {
$tmp['area'] = 'goalkeeper';
$tmp['color_pos'] = 'gray';
} else {
$tmp['area'] = 'defence';
$tmp['color_pos'] = 'success';
if (in_array($val->details->position, $positions_map['MIDFIELD'])) {
$tmp['area'] = 'midfield';
$tmp['color_pos'] = 'info';
} elseif (in_array($val->details->position, $positions_map['DEFENCE'])) {
$tmp['area'] = 'defence';
$tmp['color_pos'] = 'success';
} elseif (in_array($val->details->position, $positions_map['ATTACK'])) {
$tmp['area'] = 'attack';
$tmp['color_pos'] = 'warning';
} elseif (in_array($val->details->position, $positions_map['GOALKEEPER'])) {
$tmp['area'] = 'goalkeeper';
$tmp['color_pos'] = 'gray';
} else {
$tmp['area'] = 'defence';
$tmp['color_pos'] = 'success';
}
}
}
$result[] = $tmp;
$result[] = $tmp;
}
}
// dd($result);