min max for asp

This commit is contained in:
salam committed 2026-10-09 18:16:10 +02:00
1 parent 274d653f95
commit 01b62be635
4 files changed
+102 -9

No files matched your search

@@ -5,6 +5,7 @@ namespace App\Filament\Widgets\Boxes;
use App\Filament\Widgets\Boxes\Helper\ExpectationCalculationMethodA;
use App\Filament\Widgets\Boxes\Helper\ExpectationCalculationMethodB;
use App\Filament\Widgets\Boxes\Helper\ExpectationCollecting;
use App\Filament\Widgets\Boxes\Helper\ExpectationsMinMax;
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryAll;
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryTP;
use App\Utilities\Round;
@@ -19,6 +20,7 @@ class ExpectationsTeam
* STATTISTIC DATA
*/
$team_id = (int) $filter['team_id'] ?? 0;
$league_id = (int) $filter['league_id'] ?? 0;
$team_position = $filter['team_position'];
$similar_past_matches = $filter['similar_past_matches'];
@@ -34,20 +36,13 @@ class ExpectationsTeam
$res = LoadEventsQueryAll::load($filter, $match);
$res_tp = LoadEventsQueryTP::load($filter, $match);
$count_tp = $res_tp->count();
// $count_events = ExpectationCounting::count($team_position, $team_id, $res);
// Log::debug('count_events ' . $count_events);
if (! $res) {
return [];
}
$tmp = [];
foreach ($res as $value) {
// dd($match->home_id, $match->away_id, $value);
ExpectationCollecting::sort($similar_past_matches, $tmp, 'gls', $value->home_id, $value->away_id, $value->gls_h, $value->gls_a, $match);
ExpectationCollecting::sort($similar_past_matches, $tmp, 'fls', $value->home_id, $value->away_id, $value->fls_h, $value->fls_a, $match);
ExpectationCollecting::sort($similar_past_matches, $tmp, 'ofs', $value->home_id, $value->away_id, $value->ofs_h, $value->ofs_a, $match);
@@ -63,6 +58,10 @@ class ExpectationsTeam
$expectations = ExpectationCalculationMethodB::calc($tmp);
}
// dd($expectations);
ExpectationsMinMax::calc($expectations, $league_id);
$expectations['gls']['name'] = 'Goals';
$expectations['crn']['name'] = 'Corner';
$expectations['fls']['name'] = 'Fouls';
@@ -72,6 +71,10 @@ class ExpectationsTeam
$expectations['tsh']['name'] = 'Total Shots';
$expectations['home'] = $home_team;
$expectations['away'] = $away_team;
$res_tp = LoadEventsQueryTP::load($filter, $match);
$count_tp = $res_tp->count();
$expectations['count_events'] = $count_tp;
$expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0];