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 = [];
|
||||
foreach ($player as $val) {
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = $val->ss_player_id;
|
||||
$tmp['name'] = $val->details->player_name;
|
||||
$tmp['pos_ori'] = $val->details->position;
|
||||
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['foot'] = $val->details->preferred_foot;
|
||||
$tmp['tot_evt'] = $val->total_events;
|
||||
$tmp['tot_min'] = $val->total_min;
|
||||
$tmp['ave_min'] = $val->average_min;
|
||||
@@ -44,21 +51,26 @@ class PlayerCalculator extends Component
|
||||
}
|
||||
}
|
||||
|
||||
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'])) {
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user