wip performance

This commit is contained in:
salam committed 2026-09-25 11:08:33 +02:00
1 parent 7bf4258c4a
commit 5ffbc07564
11 files changed
+575 -32

No files matched your search

@@ -3,6 +3,7 @@
namespace App\Filament\Widgets\Charts\LoadEvents;
use App\Filament\Pages\Selections\Helper\GetSeason;
use App\Models\SofaScoreRosa;
use App\Models\StatistikoEvent;
use App\Models\StatistikoPlayer;
use Illuminate\Support\Facades\Log;
@@ -87,19 +88,20 @@ class LoadEventsQuery
}
}
$team_map = SofaScoreRosa::pluck('ss_team_name', 'ss_team_id')->toArray();
// dd($handicap_range, $total_range);
/**
* STATTISTIC DATA
*/
// dd($team_id, $home_id, $away_id);
$res = StatistikoEvent::with('home')->with('away')
->where(function ($query) use ($league_id, $similar_past_matches) {
switch ($similar_past_matches) {
case 'none':
case 'league':
return $query->where('league_id', $league_id);
}
})
$res = StatistikoEvent::where(function ($query) use ($league_id, $similar_past_matches) {
switch ($similar_past_matches) {
case 'none':
case 'league':
return $query->where('league_id', $league_id);
}
})
->where(function ($query) use ($team_id, $home_id, $away_id, $similar_past_matches) {
if ($similar_past_matches == 'none') {
if ($team_id) {
@@ -155,8 +157,8 @@ class LoadEventsQuery
$tmp['exp_handicap'] = $value->exp_handicap;
$tmp['exp_total'] = $value->exp_total;
$tmp['result_code'] = $value->result_code;
$tmp['home'] = $value->home->ss_team_name ?? 0;
$tmp['away'] = $value->away->ss_team_name ?? 0;
$tmp['home'] = $team_map[$value->home_id] ?? 0;
$tmp['away'] = $team_map[$value->away_id] ?? 0;
switch ($statistic_type) {
case 'gls':