wip
This commit is contained in:
1 parent
74ff567cce
commit
916fb91895
9 files changed
+503
-346
No files matched your search
@@ -6,6 +6,7 @@ use App\Filament\Widgets\Boxes\Helper\ExpectationCalculation;
|
||||
use App\Filament\Widgets\Boxes\Helper\ExpectationCollecting;
|
||||
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryAll;
|
||||
use App\Utilities\Round;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ExpectationsTeam
|
||||
{
|
||||
@@ -29,20 +30,24 @@ class ExpectationsTeam
|
||||
}
|
||||
|
||||
$res = LoadEventsQueryAll::load($filter, $match);
|
||||
|
||||
$count_events = $res->count();
|
||||
if (! $res) {
|
||||
return [];
|
||||
}
|
||||
$tmp = [];
|
||||
foreach ($res as $value) {
|
||||
ExpectationCollecting::sort($tmp, 'gls', $value->home_id, $value->away_id, $value->gls_h, $value->gls_a, $match);
|
||||
ExpectationCollecting::sort($tmp, 'fls', $value->home_id, $value->away_id, $value->fls_h, $value->fls_a, $match);
|
||||
ExpectationCollecting::sort($tmp, 'ofs', $value->home_id, $value->away_id, $value->ofs_h, $value->ofs_a, $match);
|
||||
ExpectationCollecting::sort($tmp, 'crd', $value->home_id, $value->away_id, $value->crd_h, $value->crd_a, $match);
|
||||
ExpectationCollecting::sort($tmp, 'snt', $value->home_id, $value->away_id, $value->snt_h, $value->snt_a, $match);
|
||||
ExpectationCollecting::sort($tmp, 'tsh', $value->home_id, $value->away_id, $value->tsh_h, $value->tsh_a, $match);
|
||||
ExpectationCollecting::sort($tmp, 'crn', $value->home_id, $value->away_id, $value->crn_h, $value->crn_a, $match);
|
||||
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);
|
||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'crd', $value->home_id, $value->away_id, $value->crd_h, $value->crd_a, $match);
|
||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'snt', $value->home_id, $value->away_id, $value->snt_h, $value->snt_a, $match);
|
||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'tsh', $value->home_id, $value->away_id, $value->tsh_h, $value->tsh_a, $match);
|
||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'crn', $value->home_id, $value->away_id, $value->crn_h, $value->crn_a, $match);
|
||||
}
|
||||
|
||||
// Log::debug('expectations '.$count_events, $tmp);
|
||||
|
||||
$expectations = ExpectationCalculation::calc($tmp);
|
||||
$expectations['gls']['name'] = 'Goals';
|
||||
$expectations['fls']['name'] = 'Fouls';
|
||||
@@ -53,6 +58,8 @@ class ExpectationsTeam
|
||||
$expectations['home'] = $home_team;
|
||||
$expectations['away'] = $away_team;
|
||||
|
||||
// Log::debug('expectations '.$count_events, $expectations);
|
||||
|
||||
$expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0];
|
||||
foreach ($res as $value) {
|
||||
if ($team_id && $team_position == 'home') {
|
||||
|
||||
Reference in new issue
Block a user