wip
This commit is contained in:
1 parent
fb85e4cce0
commit
13ca0d7293
1 file changed
+27
-15
@@ -16,13 +16,20 @@ class PlayerCalculator extends Component
|
|||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($player as $val) {
|
foreach ($player as $val) {
|
||||||
|
|
||||||
$tmp = [];
|
$tmp = [];
|
||||||
$tmp['id'] = $val->ss_player_id;
|
$tmp['id'] = $val->ss_player_id;
|
||||||
$tmp['name'] = $val->details->player_name;
|
if (! isset($val->details)) {
|
||||||
$tmp['pos_ori'] = $val->details->position;
|
$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['pos'] = '';
|
||||||
$tmp['active'] = 0;
|
$tmp['active'] = 0;
|
||||||
$tmp['foot'] = $val->details->preferred_foot;
|
|
||||||
$tmp['tot_evt'] = $val->total_events;
|
$tmp['tot_evt'] = $val->total_events;
|
||||||
$tmp['tot_min'] = $val->total_min;
|
$tmp['tot_min'] = $val->total_min;
|
||||||
$tmp['ave_min'] = $val->average_min;
|
$tmp['ave_min'] = $val->average_min;
|
||||||
@@ -44,21 +51,26 @@ class PlayerCalculator extends Component
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($val->details->position, $positions_map['MIDFIELD'])) {
|
if (! isset($val->details)) {
|
||||||
$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['area'] = 'goalkeeper';
|
||||||
$tmp['color_pos'] = 'gray';
|
$tmp['color_pos'] = 'gray';
|
||||||
} else {
|
} else {
|
||||||
$tmp['area'] = 'defence';
|
if (in_array($val->details->position, $positions_map['MIDFIELD'])) {
|
||||||
$tmp['color_pos'] = 'success';
|
$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;
|
||||||
|
|||||||
Reference in new issue
Block a user