wip
This commit is contained in:
1 parent
fd4c44de9c
commit
04d7bb2884
1 file changed
+13
-5
@@ -63,6 +63,14 @@ class LoadEvents
|
|||||||
|
|
||||||
$end = $filter['end_date'] ?? 0;
|
$end = $filter['end_date'] ?? 0;
|
||||||
|
|
||||||
|
$similar_past_matches = $filter['similar_past_matches'] ?? 0;
|
||||||
|
|
||||||
|
$statistic_type = $filter['statistic_type'] ?? 0;
|
||||||
|
|
||||||
|
// 'none' => 'None',
|
||||||
|
// 'league' => 'League',
|
||||||
|
// 'all' => 'All Database',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* STATTISTIC DATA
|
* STATTISTIC DATA
|
||||||
*/
|
*/
|
||||||
@@ -70,7 +78,7 @@ class LoadEvents
|
|||||||
case 'home':
|
case 'home':
|
||||||
$res = StatistikoEvent::where('league_id', $league_id)
|
$res = StatistikoEvent::where('league_id', $league_id)
|
||||||
->where('home_id', '=', $team_id)
|
->where('home_id', '=', $team_id)
|
||||||
->whereBetween('exp_home', [$exp_home_from, $exp_home_to])
|
// ->whereBetween('exp_home', [$exp_home_from, $exp_home_to])
|
||||||
->when($start, function ($query) use ($start) {
|
->when($start, function ($query) use ($start) {
|
||||||
return $query->where('starttime', '>=', $start);
|
return $query->where('starttime', '>=', $start);
|
||||||
})->when($end, function ($query) use ($end) {
|
})->when($end, function ($query) use ($end) {
|
||||||
@@ -82,7 +90,7 @@ class LoadEvents
|
|||||||
case 'away':
|
case 'away':
|
||||||
$res = StatistikoEvent::where('league_id', $league_id)
|
$res = StatistikoEvent::where('league_id', $league_id)
|
||||||
->where('away_id', '=', $team_id)
|
->where('away_id', '=', $team_id)
|
||||||
->whereBetween('exp_away', [$exp_away_from, $exp_away_to])
|
// ->whereBetween('exp_away', [$exp_away_from, $exp_away_to])
|
||||||
->when($start, function ($query) use ($start) {
|
->when($start, function ($query) use ($start) {
|
||||||
return $query->where('starttime', '>=', $start);
|
return $query->where('starttime', '>=', $start);
|
||||||
})->when($end, function ($query) use ($end) {
|
})->when($end, function ($query) use ($end) {
|
||||||
@@ -96,9 +104,9 @@ class LoadEvents
|
|||||||
->where(function ($query) use ($team_id) {
|
->where(function ($query) use ($team_id) {
|
||||||
$query->where('home_id', '=', $team_id)->orWhere('away_id', '=', $team_id);
|
$query->where('home_id', '=', $team_id)->orWhere('away_id', '=', $team_id);
|
||||||
})
|
})
|
||||||
->where(function ($query) use ($exp_home_from, $exp_home_to, $exp_away_from, $exp_away_to) {
|
// ->where(function ($query) use ($exp_home_from, $exp_home_to, $exp_away_from, $exp_away_to) {
|
||||||
$query->whereBetween('exp_home', [$exp_home_from, $exp_home_to])->orWhereBetween('exp_away', [$exp_away_from, $exp_away_to]);
|
// $query->whereBetween('exp_home', [$exp_home_from, $exp_home_to])->orWhereBetween('exp_away', [$exp_away_from, $exp_away_to]);
|
||||||
})
|
// })
|
||||||
->when($start, function ($query) use ($start) {
|
->when($start, function ($query) use ($start) {
|
||||||
return $query->where('starttime', '>=', $start);
|
return $query->where('starttime', '>=', $start);
|
||||||
})->when($end, function ($query) use ($end) {
|
})->when($end, function ($query) use ($end) {
|
||||||
|
|||||||
Reference in new issue
Block a user