notification & notes wip
This commit is contained in:
1 parent
94a3c6c472
commit
155177045b
30 files changed
+426
-320
No files matched your search
@@ -3,9 +3,6 @@
|
||||
namespace App\Filament\Resources\Events;
|
||||
|
||||
use App\Filament\Resources\Events\Pages\ListEvents;
|
||||
use App\Filament\Resources\Events\RelationManagers\BettypesRelationManager;
|
||||
use App\Filament\Resources\Events\RelationManagers\CountriesRelationManager;
|
||||
use App\Filament\Resources\Events\RelationManagers\UserNoteRelationManager;
|
||||
use App\Filament\Resources\Events\Schemas\EventForm;
|
||||
use App\Filament\Resources\Events\Tables\EventsTable;
|
||||
use App\Filament\Resources\Events\Tables\Tools\LoadPartnerDifferences;
|
||||
@@ -46,15 +43,6 @@ class EventResource extends Resource
|
||||
];
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
UserNoteRelationManager::class,
|
||||
CountriesRelationManager::class,
|
||||
BettypesRelationManager::class,
|
||||
];
|
||||
}
|
||||
|
||||
public static function getNavigationBadge(): ?string
|
||||
{
|
||||
return parent::getEloquentQuery()
|
||||
@@ -70,16 +58,25 @@ class EventResource extends Resource
|
||||
->with('country')
|
||||
->with('home')
|
||||
->with('away')
|
||||
->with('event_user_star')
|
||||
->with('event_bookmaker')
|
||||
->with('user_notes')
|
||||
->with('event_user_star')
|
||||
->with('event_user_note')
|
||||
->with('event_user_notification')
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('starttime', '>=', now());
|
||||
|
||||
if (auth()->user()->stars) {
|
||||
if (auth()->user()->filter_stars) {
|
||||
$query->whereHas('event_user_star');
|
||||
}
|
||||
|
||||
if (auth()->user()->filter_notes) {
|
||||
$query->whereHas('event_user_note');
|
||||
}
|
||||
|
||||
if (auth()->user()->filter_notification) {
|
||||
$query->whereHas('event_user_notification');
|
||||
}
|
||||
|
||||
if (auth()->user()->all_only_none > 0) {
|
||||
switch (auth()->user()->all_only_none) {
|
||||
case 1:
|
||||
@@ -96,47 +93,49 @@ class EventResource extends Resource
|
||||
$query->whereIn('id', $event_ids);
|
||||
}
|
||||
|
||||
if (in_array('odds_2ways', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_2ways.bookmaker');
|
||||
}
|
||||
if (in_array('odds_2ways_s1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_2ways_s1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_3ways', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_3ways.bookmaker');
|
||||
}
|
||||
if (in_array('odds_3ways_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_3ways_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_dc', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_dc.bookmaker');
|
||||
}
|
||||
if (in_array('odds_dnb', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_dnb.bookmaker');
|
||||
}
|
||||
if (in_array('odds_ggng', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_ggng.bookmaker');
|
||||
}
|
||||
if (in_array('odds_points', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points.bookmaker');
|
||||
}
|
||||
if (in_array('odds_points_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_points_q1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points_q1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals_q1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals_q1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_tq', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_tq.bookmaker');
|
||||
if (isset((EventsTable::$bettype_settings))) {
|
||||
if (in_array('odds_2ways', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_2ways.bookmaker');
|
||||
}
|
||||
if (in_array('odds_2ways_s1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_2ways_s1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_3ways', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_3ways.bookmaker');
|
||||
}
|
||||
if (in_array('odds_3ways_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_3ways_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_dc', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_dc.bookmaker');
|
||||
}
|
||||
if (in_array('odds_dnb', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_dnb.bookmaker');
|
||||
}
|
||||
if (in_array('odds_ggng', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_ggng.bookmaker');
|
||||
}
|
||||
if (in_array('odds_points', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points.bookmaker');
|
||||
}
|
||||
if (in_array('odds_points_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_points_q1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points_q1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals_q1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals_q1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_tq', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_tq.bookmaker');
|
||||
}
|
||||
}
|
||||
|
||||
return $query;
|
||||
|
||||
Reference in new issue
Block a user