wip sudamerica comppa e ueva coppas
This commit is contained in:
1 parent
b20fcb0034
commit
54bbb420ec
5 files changed
+14
-5
No files matched your search
@@ -4,12 +4,14 @@ namespace App\Actions;
|
||||
|
||||
use App\Models\SofaScoreTournament;
|
||||
use App\Models\StatisticFixtures;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class LoadSofaScoreCategory
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
$league_ids = StatisticFixtures::where('sport_id', 1)
|
||||
->where('starttime', '>=', Carbon::now())
|
||||
->groupBy('league_id')
|
||||
->pluck('league_id')->toArray();
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
namespace App\Actions;
|
||||
|
||||
use App\Models\StatisticFixtures;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class LoadStatisticFixturesLeaguesOptions
|
||||
{
|
||||
public static function load(?int $sofascore_category_id = 0)
|
||||
{
|
||||
$res = StatisticFixtures::with('league')
|
||||
->where('starttime', '>=', Carbon::now())
|
||||
->whereHas('league', function ($query) use ($sofascore_category_id) {
|
||||
$query->where('sofa_score_category_id', $sofascore_category_id);
|
||||
})
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Actions;
|
||||
|
||||
use App\Models\SofaScoreRosa;
|
||||
use App\Models\StatisticFixtures;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class LoadStatisticFixturesMatchOptions
|
||||
{
|
||||
@@ -14,11 +15,15 @@ class LoadStatisticFixturesMatchOptions
|
||||
}
|
||||
$team_map = SofaScoreRosa::pluck('ss_team_name', 'ss_team_id')->toArray();
|
||||
|
||||
$res = StatisticFixtures::where('league_id', $league_id)->get();
|
||||
$res = StatisticFixtures::where('league_id', $league_id)
|
||||
->where('starttime', '>=', Carbon::now())
|
||||
->get();
|
||||
|
||||
$arr = [];
|
||||
foreach ($res as $val) {
|
||||
$arr[$val->id] = $val->starttime->format('Y-m-d H:i').' - '.$team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
||||
if (isset($team_map[$val->home_id]) && isset($team_map[$val->away_id])) {
|
||||
$arr[$val->id] = $val->starttime->format('Y-m-d H:i').' - '.$team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
|
||||
Reference in new issue
Block a user