wip del err

This commit is contained in:
salam committed 2026-10-04 15:22:39 +02:00
1 parent 812736ca9a
commit 9bcd4432c6
1210 files changed
-220941

No files matched your search

@@ -1,12 +0,0 @@
<?php
namespace App\Filament\Widgets\Boxes\Helper;
class ExpectationAverage
{
public static function filter(array &$result, string $type, string $bettype, float $val_home, float $val_away)
{
$result[$type][$bettype]['home'][] = (int) $val_home;
$result[$type][$bettype]['away'][] = (int) $val_away;
}
}
@@ -1,54 +0,0 @@
<?php
namespace App\Filament\Widgets\Boxes\Helper;
use App\Models\StatistikoConfig;
class ExpectationCalculation
{
public static function calc(array $expectations)
{
$summen = [];
$config = StatistikoConfig::pluck('value', 'varname');
foreach ($config as $name => $value) {
if (isset($expectations[$name])) {
$summen[$name]['sum'] = array_sum($expectations[$name]) * $value;
$summen[$name]['cnt'] = \count($expectations[$name]);
} else {
$summen[$name]['sum'] = 0;
$summen[$name]['cnt'] = 1;
}
}
$summen2 = [];
$bets = ['gls', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
foreach ($bets as $name) {
$summen2[$name]['home']['sum'] = 0;
$summen2[$name]['home']['cnt'] = 0;
$summen2[$name]['away']['sum'] = 0;
$summen2[$name]['away']['cnt'] = 0;
}
foreach ($summen as $key => $value) {
foreach ($bets as $name) {
if (strpos($key, $name) !== false) {
if (strpos($key, 'home') !== false) {
$summen2[$name]['home']['sum'] += $value['sum'];
$summen2[$name]['home']['cnt'] += +$value['cnt'];
}
if (strpos($key, 'away') !== false) {
$summen2[$name]['away']['sum'] += $value['sum'];
$summen2[$name]['away']['cnt'] += +$value['cnt'];
}
}
}
}
$asp_result = [];
foreach ($summen2 as $bettype => $value) {
$asp_result[$bettype]['home'] = round($value['home']['sum'] / $value['home']['cnt'], 1);
$asp_result[$bettype]['away'] = round($value['away']['sum'] / $value['away']['cnt'], 1);
}
return $asp_result;
}
}
@@ -1,46 +0,0 @@
<?php
namespace App\Filament\Widgets\Boxes\Helper;
class ExpectationCollecting
{
public static function sort(array &$result, string $type, int $home_id, int $away_id, float $val_home, float $val_away, object $match)
{
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;
}
}
}