filter threshold

This commit is contained in:
salam committed 2026-01-29 08:28:33 +01:00
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 &ne; Ken</div>',
'sp8' => '<span class="text-green-500">Missing</div>',
'sp3' => '<span class="text-amber-500">Favorit &geq; </div>',
'sp4' => '<span class="text-amber-500">Favorit &leq; </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) {
Generated
+9 -9
View File
@@ -11468,16 +11468,16 @@
},
{
"name": "rector/rector",
"version": "2.3.4",
"version": "2.3.5",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "9227d7a24b0f23ae941057509364f948d5da9ab2"
"reference": "9442f4037de6a5347ae157fe8e6c7cda9d909070"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/9227d7a24b0f23ae941057509364f948d5da9ab2",
"reference": "9227d7a24b0f23ae941057509364f948d5da9ab2",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/9442f4037de6a5347ae157fe8e6c7cda9d909070",
"reference": "9442f4037de6a5347ae157fe8e6c7cda9d909070",
"shasum": ""
},
"require": {
@@ -11516,7 +11516,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.3.4"
"source": "https://github.com/rectorphp/rector/tree/2.3.5"
},
"funding": [
{
@@ -11524,7 +11524,7 @@
"type": "github"
}
],
"time": "2026-01-21T14:49:03+00:00"
"time": "2026-01-28T15:22:48+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -12814,12 +12814,12 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^8.3"
},
"platform-dev": [],
"plugin-api-version": "2.6.0"
"platform-dev": {},
"plugin-api-version": "2.9.0"
}
@@ -1,21 +1,35 @@
<div class="flex flex-row gap-3">
<div class="flex flex-row gap-2">
@role('partner_porgramm')
<x-filament::button size="xs" tooltip="Toggle Partner" wire:click="toggleStar" :color="auth()->user()->stars ? 'primary' : 'gray'"
icon="phosphor-users">
</x-filament::button>
<x-filament::button disabled="true" size="xs" tooltip="Toggle Partner" wire:click="toggleStar" :color="auth()->user()->stars ? 'primary' : 'gray'"
icon="phosphor-not-equals">
</x-filament::button>
<div></div>
<div></div>
<div></div>
@endrole
@switch(auth()->user()->all_only_none)
@case(0)
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="gray" icon="phosphor-gps"
tooltip="Showing with and without {{ auth()->user()->bookmaker->name }}">
tooltip="Toggle to show with or without {{ auth()->user()->bookmaker->name }}">
</x-filament::button>
@break
@case(1)
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="info" icon="phosphor-gps-fix"
tooltip="Showing only with {{ auth()->user()->bookmaker->name }}">
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" icon="phosphor-gps-fix"
tooltip="Only with {{ auth()->user()->bookmaker->name }}">
</x-filament::button>
@break
@case(2)
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="warning" icon="phosphor-gps-slash"
tooltip="Showing only without {{ auth()->user()->bookmaker->name }}">
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="danger" icon="phosphor-gps-slash"
tooltip="Only without {{ auth()->user()->bookmaker->name }}">
</x-filament::button>
@break