wip
This commit is contained in:
1 parent
02f008e1ba
commit
e9921ea26d
1 file changed
+14
-5
@@ -594,14 +594,15 @@ class PlayerPropsDrop extends Widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->calculationVariables = $results;
|
|
||||||
|
|
||||||
foreach ($this->players as $k => $player) {
|
foreach ($this->players as $k => $player) {
|
||||||
foreach ($results as $key => $result) {
|
foreach ($results as $key => $result) {
|
||||||
if ((int) $player['id'] == (int) $result['id']) {
|
if ((int) $player['id'] == (int) $result['id']) {
|
||||||
$this->players[$k]['active'] = $result['active'];
|
$this->players[$k]['active'] = $result['active'];
|
||||||
|
|
||||||
|
|
||||||
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('gls', '>', $result['asp_player_goals'])->first();
|
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('gls', '>', $result['asp_player_goals'])->first();
|
||||||
|
$results[$key]['asp_mini_pos_gls'] = $min->gls ?? 0;
|
||||||
if ($min) {
|
if ($min) {
|
||||||
$this->players[$k]['gls'] = number_format($min->gls, 3);
|
$this->players[$k]['gls'] = number_format($min->gls, 3);
|
||||||
} else {
|
} else {
|
||||||
@@ -609,6 +610,7 @@ class PlayerPropsDrop extends Widget
|
|||||||
}
|
}
|
||||||
|
|
||||||
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('fls', '>', $result['asp_player_fouls'])->first();
|
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('fls', '>', $result['asp_player_fouls'])->first();
|
||||||
|
$results[$key]['asp_mini_pos_fls'] = $min->fls ?? 0;
|
||||||
if ($min) {
|
if ($min) {
|
||||||
$this->players[$k]['fls'] = number_format($min->fls, 3);
|
$this->players[$k]['fls'] = number_format($min->fls, 3);
|
||||||
} else {
|
} else {
|
||||||
@@ -616,29 +618,33 @@ class PlayerPropsDrop extends Widget
|
|||||||
}
|
}
|
||||||
|
|
||||||
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('ofs', '>', $result['asp_player_offsides'])->first();
|
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('ofs', '>', $result['asp_player_offsides'])->first();
|
||||||
|
$results[$key]['asp_mini_pos_ofs'] = $min->ofs ?? 0;
|
||||||
if ($min) {
|
if ($min) {
|
||||||
$this->players[$k]['ofs'] = number_format($min->fls, 3);
|
$this->players[$k]['ofs'] = number_format($min->ofs, 3);
|
||||||
} else {
|
} else {
|
||||||
$this->players[$k]['ofs'] = number_format($result['asp_player_offsides'], 3);
|
$this->players[$k]['ofs'] = number_format($result['asp_player_offsides'], 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('snt', '>', $result['asp_player_shots_on_target'])->first();
|
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('snt', '>', $result['asp_player_shots_on_target'])->first();
|
||||||
|
$results[$key]['asp_mini_pos_snt'] = $min->snt ?? 0;
|
||||||
if ($min) {
|
if ($min) {
|
||||||
$this->players[$k]['snt'] = number_format($min->fls, 3);
|
$this->players[$k]['snt'] = number_format($min->snt, 3);
|
||||||
} else {
|
} else {
|
||||||
$this->players[$k]['snt'] = number_format($result['asp_player_total_shots'], 3);
|
$this->players[$k]['snt'] = number_format($result['asp_player_total_shots'], 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('tsh', '>', $result['asp_player_total_shots'])->first();
|
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('tsh', '>', $result['asp_player_total_shots'])->first();
|
||||||
|
$results[$key]['asp_mini_pos_tsh'] = $min->tsh ?? 0;
|
||||||
if ($min) {
|
if ($min) {
|
||||||
$this->players[$k]['tsh'] = number_format($min->fls, 3);
|
$this->players[$k]['tsh'] = number_format($min->tsh, 3);
|
||||||
} else {
|
} else {
|
||||||
$this->players[$k]['tsh'] = number_format($result['asp_player_shots_on_target'], 3);
|
$this->players[$k]['tsh'] = number_format($result['asp_player_shots_on_target'], 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('crd', '>', $result['asp_player_cards'])->first();
|
$min = ExpectedMinimumPosition::where('position', $this->players[$k]['pos'])->where('crd', '>', $result['asp_player_cards'])->first();
|
||||||
|
$results[$key]['asp_mini_pos_crd'] = $min->crd ?? 0;
|
||||||
if ($min) {
|
if ($min) {
|
||||||
$this->players[$k]['crd'] = number_format($min->fls, 3);
|
$this->players[$k]['crd'] = number_format($min->crd, 3);
|
||||||
} else {
|
} else {
|
||||||
$this->players[$k]['crd'] = number_format($result['asp_player_cards'], 3);
|
$this->players[$k]['crd'] = number_format($result['asp_player_cards'], 3);
|
||||||
}
|
}
|
||||||
@@ -646,6 +652,9 @@ class PlayerPropsDrop extends Widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->calculationVariables = $results;
|
||||||
|
|
||||||
|
|
||||||
$this->dispatch('update-players', players: $this->players);
|
$this->dispatch('update-players', players: $this->players);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user