diff --git a/app/Console/Commands/Services/Tasks/GenerateAlarms.php b/app/Console/Commands/Services/Tasks/GenerateAlarms.php index c4ffa91e..47bdbbe7 100644 --- a/app/Console/Commands/Services/Tasks/GenerateAlarms.php +++ b/app/Console/Commands/Services/Tasks/GenerateAlarms.php @@ -38,7 +38,7 @@ class GenerateAlarms foreach ($client->sport as $sport_id) { if ($debug) { - Notice::note('Sport: '.$sport_id, 'b'); + Notice::note('Sport: ' . $sport_id, 'b'); } $multilines = AlarmMultilineSetting::get($sport_id); @@ -52,7 +52,7 @@ class GenerateAlarms $res = EventBookmaker::with('event')->where('bookmaker_id', $client_bookmaker_id)->where('sport_id', $sport_id)->get(); if ($debug) { - Notice::note('Event: '.\count($res), 'b'); + Notice::note('Event: ' . \count($res), 'b'); } // $res = EventBookmaker::where('event_id', 14597944)->where('bookmaker_id', $client_bookmaker_id)->where('sport_id', $sport_id)->get(); @@ -72,7 +72,9 @@ class GenerateAlarms // check if client has odds $client_odds = AlarmFilterClient::get($odds, $client_bookmaker_id); - AlarmStore::get($table, $event->event_id, $oddnames[$table], $client_bookmaker_id, $alarm_threshold[$multiline_id], $compare_odds, $client_odds); + if (isset($oddnames[$table]) && isset($alarm_threshold[$multiline_id])) { + AlarmStore::get($table, $event->event_id, $oddnames[$table], $client_bookmaker_id, $alarm_threshold[$multiline_id], $compare_odds, $client_odds); + } } } }