This commit is contained in:
salam committed 2026-06-14 11:09:49 +02:00
1 parent b01d336a05
commit cb20a72fcb
1 file changed
+10 -12
@@ -195,7 +195,7 @@ class EventsTable
->options(function () { ->options(function () {
$res = Event::where('has_markets', 1) $res = Event::where('has_markets', 1)
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>=', Carbon::now()) ->whereDate('starttime', '>=', Carbon::now())
->groupBy('country_id') ->groupBy('country_id')
->pluck('country_id')->toArray(); ->pluck('country_id')->toArray();
@@ -219,7 +219,7 @@ class EventsTable
->with('country') ->with('country')
->with('competition_group') ->with('competition_group')
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>', Carbon::now()) ->whereDate('starttime', '>', Carbon::now())
->whereIn('country_id', $get('country_id')) ->whereIn('country_id', $get('country_id'))
->groupBy('competition_group_id')->get(); ->groupBy('competition_group_id')->get();
} else { } else {
@@ -227,7 +227,7 @@ class EventsTable
->with('country') ->with('country')
->with('competition_group') ->with('competition_group')
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>', Carbon::now()) ->whereDate('starttime', '>', Carbon::now())
->groupBy('competition_group_id')->get(); ->groupBy('competition_group_id')->get();
} }
@@ -253,7 +253,7 @@ class EventsTable
$res = Event::where('has_markets', 1) $res = Event::where('has_markets', 1)
->with('competition_group') ->with('competition_group')
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>', Carbon::now()) ->whereDate('starttime', '>', Carbon::now())
->groupBy('competition_group_id') ->groupBy('competition_group_id')
->get(); ->get();
$arr = []; $arr = [];
@@ -330,18 +330,18 @@ class EventsTable
$end = Carbon::createFromDate($starttime_period['end']); $end = Carbon::createFromDate($starttime_period['end']);
return $query return $query
->where('starttime', '>=', $from) ->whereDate('starttime', '>=', $from)
->where('starttime', '<=', $end); ->whereDate('starttime', '<=', $end);
} elseif (isset($starttime_period['start'])) { } elseif (isset($starttime_period['start'])) {
$from = Carbon::createFromDate($starttime_period['start']); $from = Carbon::createFromDate($starttime_period['start']);
return $query return $query
->where('starttime', '>=', $from); ->whereDate('starttime', '>=', $from);
} elseif (isset($starttime_period['end'])) { } elseif (isset($starttime_period['end'])) {
$end = Carbon::createFromDate($starttime_period['end']); $end = Carbon::createFromDate($starttime_period['end']);
return $query return $query
->where('starttime', '<=', $end); ->whereDate('starttime', '<=', $end);
} }
} }
)->when( )->when(
@@ -408,7 +408,6 @@ class EventsTable
case 5: case 5:
$event_ids = LoadCompareDifferences::load($opt[0], $opt[1], 'odds_2ways', $compare_bookmaker_id); $event_ids = LoadCompareDifferences::load($opt[0], $opt[1], 'odds_2ways', $compare_bookmaker_id);
break; break;
} }
$query->whereIn('id', $event_ids); $query->whereIn('id', $event_ids);
} }
@@ -418,7 +417,8 @@ class EventsTable
function (Builder $query, $filter_stars) { function (Builder $query, $filter_stars) {
$query->whereHas('event_user_star'); $query->whereHas('event_user_star');
} }
)->when(in_array('odds_tq', self::$bettype_settings), )->when(
in_array('odds_tq', self::$bettype_settings),
function (Builder $query, $filter_stars) { function (Builder $query, $filter_stars) {
$query->whereHas('odds_tq'); $query->whereHas('odds_tq');
} }
@@ -452,7 +452,6 @@ class EventsTable
$query->where('bookmaker_id', auth()->user()->bookmaker_id)->whereRaw('LEAST(h2w, a2w) BETWEEN ? AND ?', [1, $favorit_threshold]); $query->where('bookmaker_id', auth()->user()->bookmaker_id)->whereRaw('LEAST(h2w, a2w) BETWEEN ? AND ?', [1, $favorit_threshold]);
}); });
break; break;
} }
} }
); );
@@ -545,7 +544,6 @@ class EventsTable
case 5: case 5:
$indicators[] = Indicator::make('ML Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning'); $indicators[] = Indicator::make('ML Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
break; break;
} }
} }