This commit is contained in:
salam committed 2026-09-23 16:33:26 +02:00
1 parent b74c374586
commit 1a46e5d887
6 files changed
+60 -18

No files matched your search

+12
View File
@@ -14,6 +14,18 @@ class LoadSofaScoreCategory
->groupBy('league_id')
->pluck('league_id')->toArray();
/*
0 => 24
1 => 25
2 => 54
3 => 131
4 => 192
5 => 242
6 => 406
7 => 11539
8 => 11621
*/
$sofa_score_category_id = SofaScoreTournament::whereIn('tournament_id', $league_ids)->pluck('sofa_score_category_id')->toArray();
$sofa_score_category_id = array_unique($sofa_score_category_id);
@@ -2,16 +2,23 @@
namespace App\Actions;
use App\Models\SofaScoreTournament;
use App\Models\StatisticFixtures;
class LoadStatisticFixturesLeaguesOptions
{
public static function load(int|null $sofascore_category_id = 0)
public static function load(?int $sofascore_category_id = 0)
{
// $res = StatisticFixtures::with('league')->where('league_id', $sofascore_category_id)
// ->groupBy('league_id')
// ->pluck('league_id')->toArray();
$res = StatisticFixtures::with('league')
->whereHas('league', function ($query) use ($sofascore_category_id) {
$query->where('sofa_score_category_id', $sofascore_category_id);
})
->get();
return SofaScoreTournament::where('enabled', 1)->where('sofa_score_category_id', $sofascore_category_id)->orderBy('name')->pluck('name', 'tournament_id');
$arr = [];
foreach ($res as $value) {
$arr[$value->league_id] = $value->league->name;
}
return $arr;
}
}