filter threshold
This commit is contained in:
1 parent
98e2e873e1
commit
853c6aaf8a
3 files changed
+75
-22
No files matched your search
@@ -281,7 +281,8 @@ class EventsTable
|
||||
->minValue(1.01)
|
||||
->maxValue(3.00)
|
||||
->step(0.01)
|
||||
->hiddenLabel(),
|
||||
->hiddenLabel()
|
||||
->live(),
|
||||
|
||||
Select::make('special_filter_base')
|
||||
->placeholder('Filters Base')
|
||||
@@ -290,7 +291,6 @@ class EventsTable
|
||||
->native(false)
|
||||
->allowHtml()
|
||||
->options([
|
||||
'sp1' => '<span class="text-blue-500">Nig ≠ Ken</div>',
|
||||
'sp8' => '<span class="text-green-500">Missing</div>',
|
||||
'sp3' => '<span class="text-amber-500">Favorit ≥ </div>',
|
||||
'sp4' => '<span class="text-amber-500">Favorit ≤ </div>',
|
||||
@@ -399,10 +399,35 @@ class EventsTable
|
||||
});
|
||||
});
|
||||
}
|
||||
// )->when(
|
||||
// $data('favorit_threshold'),
|
||||
// function (Builder $query, $favorit_threshold) {}
|
||||
// whereRaw("LEAST(price_one, price_two, price_three) BETWEEN ? AND ?", [$min, $max])
|
||||
|
||||
)->when(
|
||||
$data['favorit_threshold'],
|
||||
function (Builder $query, $favorit_threshold) {
|
||||
|
||||
switch (auth()->user()->sport_id) {
|
||||
case 1:
|
||||
return $query->whereHas('odds_3ways', function ($query) use ($favorit_threshold) {
|
||||
$query->where('bookmaker_id', auth()->user()->bookmaker_id)->whereRaw('LEAST(h3w, d3w, a3w) BETWEEN ? AND ?', [1, $favorit_threshold]);
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
return $query->whereHas('odds_3ways', function ($query) use ($favorit_threshold) {
|
||||
$query->where('bookmaker_id', auth()->user()->bookmaker_id)->whereRaw('LEAST(h3w, d3w, a3w) BETWEEN ? AND ?', [1, $favorit_threshold]);
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
return $query->whereHas('odds_points', function ($query) use ($favorit_threshold) {
|
||||
$query->where('bookmaker_id', auth()->user()->bookmaker_id)->where('active_spread', 1)->whereRaw('LEAST(home, away) BETWEEN ? AND ?', [1, $favorit_threshold]);
|
||||
});
|
||||
break;
|
||||
case 5:
|
||||
return $query->whereHas('odds_2ways', function ($query) use ($favorit_threshold) {
|
||||
$query->where('bookmaker_id', auth()->user()->bookmaker_id)->whereRaw('LEAST(h2w, a2w) BETWEEN ? AND ?', [1, $favorit_threshold]);
|
||||
});
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
})->indicateUsing(function (array $data): array {
|
||||
$indicators = [];
|
||||
@@ -463,7 +488,21 @@ class EventsTable
|
||||
}
|
||||
|
||||
if ($data['favorit_threshold'] ?? null) {
|
||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
switch (auth()->user()->sport_id) {
|
||||
case 1:
|
||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
break;
|
||||
case 2:
|
||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
break;
|
||||
case 3:
|
||||
$indicators[] = Indicator::make('PO Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
break;
|
||||
case 5:
|
||||
$indicators[] = Indicator::make('ML Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['stars_status'] ?? null) {
|
||||
|
||||
Reference in new issue
Block a user