51 lines
2.4 KiB
PHP
51 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Widgets\Boxes\Helper;
|
|
|
|
class ExpectationCollecting
|
|
{
|
|
public static function sort(string $similar_past_matches, array &$result, string $type, int $home_id, int $away_id, float $val_home, float $val_away, object $match)
|
|
{
|
|
if ($similar_past_matches != 'none') {
|
|
$result[$type.'_home_made_total'][] = $val_home;
|
|
$result[$type.'_away_made_total'][] = $val_away;
|
|
} else {
|
|
if ($home_id == $match->home_id) {
|
|
$result[$type.'_home_made_total'][] = $val_home;
|
|
$result[$type.'_home_made_home'][] = $val_home;
|
|
$result[$type.'_home_got_total'][] = $val_away;
|
|
$result[$type.'_home_got_home'][] = $val_away;
|
|
} elseif ($away_id == $match->home_id) {
|
|
$result[$type.'_home_made_total'][] = $val_away;
|
|
$result[$type.'_home_got_total'][] = $val_away;
|
|
} elseif ($home_id == $match->away_id) {
|
|
$result[$type.'_home_made_total'][] = $val_away;
|
|
$result[$type.'_home_got_total'][] = $val_away;
|
|
} elseif ($away_id == $match->away_id) {
|
|
$result[$type.'_home_made_total'][] = $val_home;
|
|
$result[$type.'_home_made_home'][] = $val_home;
|
|
$result[$type.'_home_got_total'][] = $val_away;
|
|
$result[$type.'_home_got_home'][] = $val_home;
|
|
}
|
|
|
|
if ($away_id == $match->away_id) {
|
|
$result[$type.'_away_made_total'][] = $val_away;
|
|
$result[$type.'_away_made_home'][] = $val_away;
|
|
$result[$type.'_away_got_total'][] = $val_home;
|
|
$result[$type.'_away_got_home'][] = $val_home;
|
|
} elseif ($home_id == $match->away_id) {
|
|
$result[$type.'_away_made_total'][] = $val_home;
|
|
$result[$type.'_away_got_total'][] = $val_home;
|
|
} elseif ($away_id == $match->home_id) {
|
|
$result[$type.'_away_made_total'][] = $val_home;
|
|
$result[$type.'_away_got_total'][] = $val_home;
|
|
} elseif ($home_id == $match->home_id) {
|
|
$result[$type.'_away_made_total'][] = $val_away;
|
|
$result[$type.'_away_made_home'][] = $val_away;
|
|
$result[$type.'_away_got_total'][] = $val_home;
|
|
$result[$type.'_away_got_home'][] = $val_away;
|
|
}
|
|
}
|
|
}
|
|
}
|