fix box 1
This commit is contained in:
1 parent
4ec3a86c9e
commit
c49f5e2364
7 files changed
+230
-194
No files matched your search
@@ -8,7 +8,7 @@ use App\Models\StatistikoPlayer;
|
||||
|
||||
class LoadEventsQuery
|
||||
{
|
||||
public static function load(array $filter, array $handicap_range, array $total_range, object $match)
|
||||
public static function load(array $filter, array $handicap_range, array $total_range, object $match)
|
||||
{
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
@@ -84,8 +84,6 @@ class LoadEventsQuery
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
|
||||
|
||||
// dd($team_id, $home_id, $away_id);
|
||||
$res = StatistikoEvent::with('home')->with('away')
|
||||
->where(function ($query) use ($league_id, $similar_past_matches) {
|
||||
@@ -122,13 +120,14 @@ class LoadEventsQuery
|
||||
return $query->whereDate('starttime', '<=', $end);
|
||||
})
|
||||
->when($season, function ($query) use ($season, $season_or_date) {
|
||||
if ($season_or_date == 'season')
|
||||
if ($season_or_date == 'season') {
|
||||
return $query->whereIn('season', $season);
|
||||
}
|
||||
})
|
||||
->orderBy('starttime', 'ASC')
|
||||
->get();
|
||||
|
||||
// dd($season, $res);
|
||||
// dd($season, $team_id, $home_id, $away_id, $res);
|
||||
|
||||
$arr = [];
|
||||
foreach ($res as $value) {
|
||||
@@ -181,10 +180,12 @@ class LoadEventsQuery
|
||||
}
|
||||
|
||||
$arr['all'][] = $tmp;
|
||||
if ($value->home_id == $team_id)
|
||||
if ($value->home_id == $team_id) {
|
||||
$arr['home'][] = $tmp;
|
||||
if ($value->away_id == $team_id)
|
||||
}
|
||||
if ($value->away_id == $team_id) {
|
||||
$arr['away'][] = $tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
|
||||
Reference in new issue
Block a user