TP for boxes and grafic wip
This commit is contained in:
1 parent
1fbf53cf1f
commit
28882bfdb5
3 files changed
+28
-43
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\Boxes\Helper\ExpectationCounting;
|
||||
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryAll;
|
||||
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryTP;
|
||||
use App\Utilities\Round;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -31,9 +32,12 @@ class ExpectationsTeam
|
||||
}
|
||||
|
||||
$res = LoadEventsQueryAll::load($filter, $match);
|
||||
$count_events_selection = $res->count();
|
||||
|
||||
$count_events = ExpectationCounting::count($team_position, $team_id, $res);
|
||||
$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);
|
||||
|
||||
@@ -62,10 +66,10 @@ class ExpectationsTeam
|
||||
$expectations['tsh']['name'] = 'Total Shots';
|
||||
$expectations['home'] = $home_team;
|
||||
$expectations['away'] = $away_team;
|
||||
$expectations['count_events'] = $count_events;
|
||||
$expectations['count_events'] = $count_tp;
|
||||
|
||||
$expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0];
|
||||
foreach ($res as $value) {
|
||||
foreach ($res_tp as $value) {
|
||||
if ($team_id && $team_position == 'home') {
|
||||
switch ($value['result_code']) {
|
||||
case '1':
|
||||
@@ -105,8 +109,8 @@ class ExpectationsTeam
|
||||
}
|
||||
}
|
||||
|
||||
$expectations['win_odd'] = $expectations['win_count'] ? number_format(Round::odd($count_events_selection / $expectations['win_count']), 2) : 0;
|
||||
$expectations['draw_odd'] = $expectations['draw_count'] ? number_format(Round::odd($count_events_selection / $expectations['draw_count']), 2) : 0;
|
||||
$expectations['lost_odd'] = $expectations['lost_count'] ? number_format(Round::odd($count_events_selection / $expectations['lost_count']), 2) : 0;
|
||||
$expectations['win_odd'] = $expectations['win_count'] ? number_format(Round::odd($count_tp / $expectations['win_count']), 2) : 0;
|
||||
$expectations['draw_odd'] = $expectations['draw_count'] ? number_format(Round::odd($count_tp / $expectations['draw_count']), 2) : 0;
|
||||
$expectations['lost_odd'] = $expectations['lost_count'] ? number_format(Round::odd($count_tp / $expectations['lost_count']), 2) : 0;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user