From 34690292aaef478c08049c501f73ffabd05d1802 Mon Sep 17 00:00:00 2001 From: salam Date: Fri, 2 Jan 2026 12:20:08 +0100 Subject: [PATCH] grapper betsapi ok --- .../Commands/Grapper/Betsapi/Bet365.php | 107 +- .../Commands/Grapper/Betsapi/Fixtures.php | 11 + .../Commands/Grapper/Betsapi/Willhill.php | 56 +- app/Console/Commands/TestFiles/fixtures.json | 1329 ++++++++++++++++- .../Resources/Events/Tables/EventsTable.php | 8 +- app/Livewire/MapperLeft.php | 21 +- app/Livewire/MapperRight.php | 48 +- app/Mapper/FindEvent.php | 59 +- app/Mapper/StoreMapped.php | 107 ++ app/Models/Mapper.php | 6 +- ...2025_12_19_111819_create_mappers_table.php | 3 + .../columns/mapper-left-column.blade.php | 2 +- .../columns/mapper-right-column.blade.php | 8 +- .../views/livewire/confirm-mapping.blade.php | 80 +- .../views/livewire/top-menu-items.blade.php | 3 +- 15 files changed, 1751 insertions(+), 97 deletions(-) create mode 100644 app/Mapper/StoreMapped.php diff --git a/app/Console/Commands/Grapper/Betsapi/Bet365.php b/app/Console/Commands/Grapper/Betsapi/Bet365.php index 3aeff43a..2b589428 100644 --- a/app/Console/Commands/Grapper/Betsapi/Bet365.php +++ b/app/Console/Commands/Grapper/Betsapi/Bet365.php @@ -7,6 +7,9 @@ use App\Console\Commands\Nuh; use App\Models\Event; use App\Models\Odds3way; use App\Models\OddsDc; +use App\Models\OddsDnb; +use App\Models\OddsGgng; +use App\Models\OddsTotal; use App\Utilities\Margin; use Illuminate\Support\Carbon; @@ -34,46 +37,92 @@ class Bet365 $offer = $data['results'][0]['main']['sp']; + $base = []; + $base['sport_id'] = $event->sport_id; + $base['provider_id'] = Nuh::$options['provider_id']; + $base['bmoid'] = $event->bet365_id; + $base['flag'] = 1; + $base['last_check_at'] = Carbon::now(); + /** * 1X2 */ - $odds = []; - $odds['h3w'] = $offer['full_time_result']['odds'][0]['odds']; - $odds['d3w'] = $offer['full_time_result']['odds'][1]['odds']; - $odds['a3w'] = $offer['full_time_result']['odds'][2]['odds']; - $odds['margin'] = (float) Margin::calculate([$odds['h3w'], $odds['d3w'], $odds['a3w']], 1); - $odds['sport_id'] = $event->sport_id; - $odds['provider_id'] = Nuh::$options['provider_id']; - $odds['bmoid'] = $event->bet365_id; - $odds['flag'] = 1; - $odds['last_check_at'] = Carbon::now(); + if (isset($offer['full_time_result'])) { + $odds = []; + $odds['h3w'] = $offer['full_time_result']['odds'][0]['odds'] ?? 1; + $odds['d3w'] = $offer['full_time_result']['odds'][1]['odds'] ?? 1; + $odds['a3w'] = $offer['full_time_result']['odds'][2]['odds'] ?? 1; + $odds['margin'] = (float) Margin::calculate($odds, 1); - Odds3way::updateOrCreate([ - 'event_id' => $event->id, - 'bookmaker_id' => $bookmaker_id, - ], $odds); + Odds3way::updateOrCreate([ + 'event_id' => $event->id, + 'bookmaker_id' => $bookmaker_id, + ], $base + $odds); + } /** * DC */ - $odds = []; - $odds['dc1x'] = $offer['full_time_result']['odds'][0]['odds']; - $odds['dc12'] = $offer['full_time_result']['odds'][1]['odds']; - $odds['dcx2'] = $offer['full_time_result']['odds'][2]['odds']; - $odds['margin'] = (float) Margin::calculate([$odds['dc1x'], $odds['dc12'], $odds['dcx2']], 1); - $odds['sport_id'] = $event->sport_id; - $odds['provider_id'] = Nuh::$options['provider_id']; - $odds['bmoid'] = $event->bet365_id; - $odds['flag'] = 1; - $odds['last_check_at'] = Carbon::now(); + if (isset($offer['double_chance'])) { + $odds = []; + $odds['dc1x'] = $offer['double_chance']['odds'][0]['odds'] ?? 1; + $odds['dc12'] = $offer['double_chance']['odds'][1]['odds'] ?? 1; + $odds['dcx2'] = $offer['double_chance']['odds'][2]['odds'] ?? 1; + $odds['margin'] = (float) Margin::calculate($odds, 1); - OddsDc::updateOrCreate([ - 'event_id' => $event->id, - 'bookmaker_id' => $bookmaker_id, - ], $odds); + OddsDc::updateOrCreate([ + 'event_id' => $event->id, + 'bookmaker_id' => $bookmaker_id, + ], $base + $odds); + } - dd($odds); + /** + * OU + */ + if (isset($offer['goals_over_under'])) { + $odds = []; + $odds['over'] = $offer['goals_over_under']['odds'][0]['odds'] ?? 1; + $odds['under'] = $offer['goals_over_under']['odds'][1]['odds'] ?? 1; + $odds['margin'] = (float) Margin::calculate($odds, 1); + if ((float) $offer['goals_over_under']['odds'][1]['name'] == 2.5) { + OddsTotal::updateOrCreate([ + 'event_id' => $event->id, + 'bookmaker_id' => $bookmaker_id, + 'total' => 2.5, + ], $base + $odds); + } + } + + /** + * GG NG + */ + if (isset($offer['both_teams_to_score'])) { + $odds = []; + $odds['gg'] = $offer['both_teams_to_score']['odds'][0]['odds'] ?? 1; + $odds['ng'] = $offer['both_teams_to_score']['odds'][1]['odds'] ?? 1; + $odds['margin'] = (float) Margin::calculate($odds, 1); + + OddsGgng::updateOrCreate([ + 'event_id' => $event->id, + 'bookmaker_id' => $bookmaker_id, + ], $base + $odds); + } + + /** + * DNB + */ + if (isset($offer['draw_no_bet'])) { + $odds = []; + $odds['dnb1'] = $offer['draw_no_bet']['odds'][0]['odds'] ?? 1; + $odds['dnb2'] = $offer['draw_no_bet']['odds'][1]['odds'] ?? 1; + $odds['margin'] = (float) Margin::calculate($odds, 1); + + OddsDnb::updateOrCreate([ + 'event_id' => $event->id, + 'bookmaker_id' => $bookmaker_id, + ], $base + $odds); + } } } } diff --git a/app/Console/Commands/Grapper/Betsapi/Fixtures.php b/app/Console/Commands/Grapper/Betsapi/Fixtures.php index 4c64c222..440e2cd3 100644 --- a/app/Console/Commands/Grapper/Betsapi/Fixtures.php +++ b/app/Console/Commands/Grapper/Betsapi/Fixtures.php @@ -7,6 +7,7 @@ use App\Console\Commands\Nuh; use App\Mapper\FindEvent; use App\Mapper\LoadElements; use App\Mapper\LoadGroups; +use App\Models\Mapper; use App\Models\Sport; use App\Utilities\Notice; use Illuminate\Support\Carbon; @@ -23,6 +24,15 @@ class Fixtures $break = Nuh::$options['b'] ?? 0; + /** + * Delete Started + */ + $info = Mapper::where('starttime', '<', Carbon::now()->toDateTimeString())->delete(); + + if ($debug) { + Notice::note("Deleted: $info"); + } + self::$elements = LoadElements::load(Nuh::$options['provider_id']); self::$groups = LoadGroups::load(Nuh::$options['provider_id']); @@ -70,6 +80,7 @@ class Fixtures $event = [ 'event_id' => (int) $row['id'], + 'bet365_id' => isset($row['bet365_id']) ? $row['bet365_id'] : 0, 'sport_id' => (int) $sport_id, 'provider_id' => (int) Nuh::$options['provider_id'], 'starttime' => Carbon::createFromTimestamp((string) $row['time'])->toDateTimeString(), diff --git a/app/Console/Commands/Grapper/Betsapi/Willhill.php b/app/Console/Commands/Grapper/Betsapi/Willhill.php index 6ed87fef..55e70464 100644 --- a/app/Console/Commands/Grapper/Betsapi/Willhill.php +++ b/app/Console/Commands/Grapper/Betsapi/Willhill.php @@ -12,6 +12,7 @@ use App\Models\Event; use App\Models\Mapper; use App\Models\Odds3way; use App\Utilities\Notice; +use Illuminate\Support\Carbon; class Willhill { @@ -53,37 +54,40 @@ class Willhill if ($betsapi_id) { - $match = Event::where('id', (int) $txodds_id)->first(); + if (isset($data['results'][0]['home'])) { - $ele = []; - $ele['sport_id'] = $sport_id; - $ele['provider_id'] = Nuh::$options['provider_id']; - $ele['element_id'] = $match->home_id ?? 0; - $ele['provider_element_id'] = $data['results'][0]['home']['id'] ?? 0; - $ele['name'] = $data['results'][0]['home']['name']; - StoreElement::store($elements, $ele); + $match = Event::where('id', (int) $txodds_id)->first(); - $ele = []; - $ele['sport_id'] = $sport_id; - $ele['provider_id'] = Nuh::$options['provider_id']; - $ele['element_id'] = $match->away_id ?? 0; - $ele['provider_element_id'] = $data['results'][0]['away']['id'] ?? 0; - $ele['name'] = $data['results'][0]['away']['name']; - StoreElement::store($elements, $ele); + $ele = []; + $ele['sport_id'] = $sport_id; + $ele['provider_id'] = Nuh::$options['provider_id']; + $ele['element_id'] = $match->home_id ?? 0; + $ele['provider_element_id'] = $data['results'][0]['home']['id'] ?? 0; + $ele['name'] = $data['results'][0]['home']['name']; + StoreElement::store($elements, $ele); - $group = []; - $group['sport_id'] = $sport_id; - $group['provider_id'] = Nuh::$options['provider_id']; - $group['competition_group_id'] = $match->competition_group_id; - $group['provider_group_id'] = $data['results'][0]['league']['id'] ?? 0; - $group['name'] = $data['results'][0]['league']['name']; - StoreGroup::store($groups, $group); + $ele = []; + $ele['sport_id'] = $sport_id; + $ele['provider_id'] = Nuh::$options['provider_id']; + $ele['element_id'] = $match->away_id ?? 0; + $ele['provider_element_id'] = $data['results'][0]['away']['id'] ?? 0; + $ele['name'] = $data['results'][0]['away']['name']; + StoreElement::store($elements, $ele); - $match->betsapi_id = $betsapi_id; - $match->bet365_id = $bet365_id; - $match->save(); + $group = []; + $group['sport_id'] = $sport_id; + $group['provider_id'] = Nuh::$options['provider_id']; + $group['competition_group_id'] = $match->competition_group_id; + $group['provider_group_id'] = $data['results'][0]['league']['id'] ?? 0; + $group['name'] = $data['results'][0]['league']['name']; + StoreGroup::store($groups, $group); - Mapper::where('event_id', $betsapi_id)->delete(); + $match->betsapi_id = $betsapi_id; + $match->bet365_id = $bet365_id; + $match->save(); + + Mapper::where('event_id', $betsapi_id)->delete(); + } } } } diff --git a/app/Console/Commands/TestFiles/fixtures.json b/app/Console/Commands/TestFiles/fixtures.json index 67ba3f57..c4a0b727 100644 --- a/app/Console/Commands/TestFiles/fixtures.json +++ b/app/Console/Commands/TestFiles/fixtures.json @@ -1 +1,1328 @@ -{"success":1,"pager":{"page":1,"per_page":50,"total":118},"results":[{"id":"11205969","sport_id":"1","time":"1767312000","time_status":"0","league":{"id":"32086","name":"Sierra Leone Premier League","cc":"sl"},"home":{"id":"807038","name":"Luawa FC","image_id":"976023","cc":"sl"},"away":{"id":"1107248","name":"Bullom Stars","image_id":"1227141","cc":"sl"},"ss":null,"bet365_id":"187264995"},{"id":"11204558","sport_id":"1","time":"1767324600","time_status":"0","league":{"id":"3726","name":"India League Women","cc":"in"},"home":{"id":"1232296","name":"Gokulam Kerala FC (W)","image_id":"417727","cc":"in"},"away":{"id":"1233191","name":"Garhwal United (W)","image_id":"1250925","cc":"in"},"ss":null,"bet365_id":"187151600"},{"id":"11204559","sport_id":"1","time":"1767324600","time_status":"0","league":{"id":"3726","name":"India League Women","cc":"in"},"home":{"id":"1176727","name":"Kickstart Karnataka FC (W)","image_id":"678415","cc":"in"},"away":{"id":"1231917","name":"Sribhumi FC (W)","image_id":"676603","cc":"in"},"ss":null,"bet365_id":"187151605"},{"id":"11204534","sport_id":"1","time":"1767331800","time_status":"0","league":{"id":"14959","name":"India Delhi Senior Division","cc":"in"},"home":{"id":"270701","name":"Jaguar FC (India)","image_id":"303564","cc":"in"},"o_home":{"id":"236714","name":"Jaguar FC","image_id":"430845","cc":"au"},"away":{"id":"1128257","name":"M2M FC","image_id":"1245746","cc":"in"},"ss":null,"bet365_id":"187151505"},{"id":"11204544","sport_id":"1","time":"1767339000","time_status":"0","league":{"id":"42582","name":"India Bengal Super League","cc":"in"},"home":{"id":"1234888","name":"Howrah Hooghly Warriors","image_id":"1313608","cc":"in"},"away":{"id":"1235171","name":"JHR Royal City FC","image_id":null,"cc":null},"ss":null,"bet365_id":"187149267"},{"id":"11202121","sport_id":"1","time":"1767340800","time_status":"0","league":{"id":"42027","name":"Algeria U20 League","cc":"dz"},"home":{"id":"1213704","name":"GC Mascara U20","image_id":"1304486","cc":"dz"},"away":{"id":"1235068","name":"MB Ain Hadjar U20","image_id":null,"cc":null},"ss":null,"bet365_id":"187233071"},{"id":"11202156","sport_id":"1","time":"1767340800","time_status":"0","league":{"id":"834","name":"Algeria Division 1","cc":"dz"},"home":{"id":"27180","name":"JS Kabylie","image_id":"42202","cc":"dz"},"away":{"id":"46305","name":"MC Alger","image_id":"42204","cc":"dz"},"ss":null,"bet365_id":"187233073"},{"id":"11204655","sport_id":"1","time":"1767340800","time_status":"0","league":{"id":"42027","name":"Algeria U20 League","cc":"dz"},"home":{"id":"1213704","name":"GC Mascara U20","image_id":"1304486","cc":"dz"},"away":{"id":"1210732","name":"Mb Ain Hdjer U20","image_id":"1302480","cc":"dz"},"ss":null},{"id":"10733545","sport_id":"1","time":"1767342600","time_status":"0","league":{"id":"820","name":"Bangladesh Premier League","cc":"bd"},"home":{"id":"48294","name":"Brothers Union","image_id":"336965","cc":"bd"},"away":{"id":"48560","name":"Mohammedan Dhaka","image_id":"275093","cc":"bd"},"ss":null,"round":"9","bet365_id":"187155183"},{"id":"11204535","sport_id":"1","time":"1767342600","time_status":"0","league":{"id":"14959","name":"India Delhi Senior Division","cc":"in"},"home":{"id":"177885","name":"Ahbab FC","image_id":"396446","cc":"in"},"away":{"id":"270807","name":"Rangers SC","image_id":"561390","cc":"in"},"ss":null,"bet365_id":"187159249"},{"id":"10650729","sport_id":"1","time":"1767342900","time_status":"0","league":{"id":"1727","name":"Australia A-League","cc":"au"},"home":{"id":"50643","name":"Melbourne Victory","image_id":"5970","cc":"au"},"away":{"id":"2463","name":"Perth Glory","image_id":"2945","cc":"au"},"ss":null,"round":"11","bet365_id":"185933007"},{"id":"11202146","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"36349","name":"Algeria Elite Championship Women","cc":"dz"},"home":{"id":"1203504","name":"Afak Relizane (W)","image_id":"509986","cc":"dz"},"away":{"id":"1213182","name":"CF Akbou (W)","image_id":"388558","cc":"dz"},"ss":null,"bet365_id":"187207243"},{"id":"11202147","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"36349","name":"Algeria Elite Championship Women","cc":"dz"},"home":{"id":"1216683","name":"CR Belouizdad (W)","image_id":"1084372","cc":"dz"},"away":{"id":"1216682","name":"ALS Batna (W)","image_id":"543765","cc":"dz"},"ss":null,"bet365_id":"187233075"},{"id":"11202148","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"36349","name":"Algeria Elite Championship Women","cc":"dz"},"home":{"id":"1213181","name":"FC Bejaia (W)","image_id":"388556","cc":"dz"},"away":{"id":"1224160","name":"RS Tissemsilt (W)","image_id":null,"cc":null},"ss":null,"bet365_id":"187233080"},{"id":"11204461","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"36349","name":"Algeria Elite Championship Women","cc":"dz"},"home":{"id":"1218636","name":"JS Kabylie (W)","image_id":"1099083","cc":"dz"},"away":{"id":"1203506","name":"CEA Setif (W)","image_id":"1100131","cc":"dz"},"ss":null,"bet365_id":"187298187"},{"id":"11204939","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"1313","name":"Israel Liga Bet North","cc":"il"},"home":{"id":"184441","name":"Netanya Kolet","image_id":null,"cc":null},"away":{"id":"1084395","name":"SC Mashhad","image_id":"1188635","cc":"il"},"ss":null,"bet365_id":"187207918"},{"id":"11204940","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"1313","name":"Israel Liga Bet North","cc":"il"},"home":{"id":"54346","name":"Maccabi Ahi Iksal","image_id":"391614","cc":"il"},"away":{"id":"950487","name":"FC Tirat HaCarmel","image_id":"786158","cc":"il"},"o_away":{"id":"373422","name":"MS Tirat HaCarmel","image_id":"786158","cc":"il"},"ss":null,"bet365_id":"187252667"},{"id":"11204941","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"1313","name":"Israel Liga Bet North","cc":"il"},"home":{"id":"1194222","name":"FC Kababir","image_id":null,"cc":null},"away":{"id":"1084328","name":"Tzeirey Haifa SC","image_id":null,"cc":null},"ss":null,"bet365_id":"187254145"},{"id":"11205045","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"1310","name":"Israel Liga Bet South","cc":"il"},"home":{"id":"49450","name":"Maccabi Ironi Kfar Yona","image_id":"39614","cc":"il"},"away":{"id":"1046054","name":"Beitar Kfar Saba","image_id":"39518","cc":"il"},"o_away":{"id":"48411","name":"Beitar Kfar Saba Shlomi","image_id":"39518","cc":"il"},"ss":null,"bet365_id":"187207916"},{"id":"11205128","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"1310","name":"Israel Liga Bet South","cc":"il"},"home":{"id":"1187812","name":"Maccabi Beer Yaakov","image_id":"1055291","cc":"il"},"away":{"id":"46068","name":"Maccabi Ironi Netivot","image_id":"39520","cc":"il"},"ss":null,"bet365_id":"187160973"},{"id":"11205129","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"1310","name":"Israel Liga Bet South","cc":"il"},"home":{"id":"1191013","name":"Beitar Tel Aviv Holon","image_id":"36264","cc":"il"},"o_home":{"id":"301202","name":"Beitar Tel Aviv Bat Yam","image_id":"36264","cc":"il"},"away":{"id":"46064","name":"AS Holon Mor","image_id":"300212","cc":"il"},"ss":null,"bet365_id":"187235875"},{"id":"11206286","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"13797","name":"Myanmar League 2","cc":"mm"},"home":{"id":"1170930","name":"YB United FC","image_id":"1277338","cc":"mm"},"away":{"id":"259290","name":"University FC","image_id":"537487","cc":"mm"},"ss":null,"bet365_id":"187161124"},{"id":"11206287","sport_id":"1","time":"1767344400","time_status":"0","league":{"id":"13797","name":"Myanmar League 2","cc":"mm"},"home":{"id":"1170823","name":"Yangon City","image_id":"1277336","cc":"mm"},"away":{"id":"260312","name":"Silver Stars","image_id":"537489","cc":"mm"},"ss":null,"bet365_id":"187161132"},{"id":"11204560","sport_id":"1","time":"1767346200","time_status":"0","league":{"id":"3726","name":"India League Women","cc":"in"},"home":{"id":"1231915","name":"Nita FA (W)","image_id":"1118417","cc":"in"},"away":{"id":"1228473","name":"East Bengal FC (W)","image_id":"1007757","cc":"in"},"o_away":{"id":"1219330","name":"East Bengal Club (W)","image_id":"1007757","cc":"in"},"ss":null,"bet365_id":"187159363"},{"id":"11204591","sport_id":"1","time":"1767346200","time_status":"0","league":{"id":"2750","name":"India Mumbai Elite League","cc":"in"},"home":{"id":"197218","name":"Millat FC","image_id":"548689","cc":"in"},"away":{"id":"321306","name":"Mumbai Ultras FC","image_id":null,"cc":"in"},"ss":null,"bet365_id":"187298338"},{"id":"11178195","sport_id":"1","time":"1767348000","time_status":"0","league":{"id":"1083","name":"Israel Liga Alef South","cc":"il"},"home":{"id":"44567","name":"Hapoel Nir Ramat Hasharon","image_id":"36274","cc":"il"},"away":{"id":"48396","name":"Hapoel Azor","image_id":"61700","cc":"il"},"ss":null,"round":"13"},{"id":"11204921","sport_id":"1","time":"1767348000","time_status":"0","league":{"id":"1083","name":"Israel Liga Alef South","cc":"il"},"home":{"id":"44567","name":"Hapoel Nir Ramat Hasharon","image_id":"36274","cc":"il"},"away":{"id":"48396","name":"Hapoel Azor","image_id":"61700","cc":"il"},"ss":null,"bet365_id":"185929040"},{"id":"11205130","sport_id":"1","time":"1767348000","time_status":"0","league":{"id":"1310","name":"Israel Liga Bet South","cc":"il"},"home":{"id":"769549","name":"Sderot","image_id":"954101","cc":"il"},"away":{"id":"187741","name":"Beitar Ironi Kiryat Gat","image_id":"385158","cc":"il"},"ss":null,"bet365_id":"187298692"},{"id":"11178193","sport_id":"1","time":"1767349800","time_status":"0","league":{"id":"1083","name":"Israel Liga Alef South","cc":"il"},"home":{"id":"46112","name":"Maccabi Yavne","image_id":"61708","cc":"il"},"away":{"id":"9539","name":"FC Beitar Yavne","image_id":"388148","cc":"il"},"ss":null,"round":"13"},{"id":"11204623","sport_id":"1","time":"1767349800","time_status":"0","league":{"id":"6655","name":"Iran Div 2","cc":"ir"},"home":{"id":"177078","name":"Shahrdari Mahshahr","image_id":"299672","cc":"ir"},"away":{"id":"929948","name":"KIA Football Academy","image_id":"1067536","cc":"ir"},"ss":null,"bet365_id":"187237470"},{"id":"11204624","sport_id":"1","time":"1767349800","time_status":"0","league":{"id":"6655","name":"Iran Div 2","cc":"ir"},"home":{"id":"1083844","name":"Omid Tehran","image_id":"1216251","cc":"ir"},"away":{"id":"175911","name":"Sepidrood Rasht","image_id":"361860","cc":"ir"},"ss":null,"bet365_id":"187237473"},{"id":"11204920","sport_id":"1","time":"1767349800","time_status":"0","league":{"id":"1083","name":"Israel Liga Alef South","cc":"il"},"home":{"id":"46112","name":"Maccabi Yavne","image_id":"61708","cc":"il"},"away":{"id":"9539","name":"FC Beitar Yavne","image_id":"388148","cc":"il"},"ss":null,"bet365_id":"185929032"},{"id":"11178192","sport_id":"1","time":"1767350100","time_status":"0","league":{"id":"1083","name":"Israel Liga Alef South","cc":"il"},"home":{"id":"262115","name":"Maccabi Kiryat Gat","image_id":"509572","cc":"il"},"away":{"id":"46106","name":"Hapoel Herzliya","image_id":"7383","cc":"il"},"ss":null,"round":"13"},{"id":"11204919","sport_id":"1","time":"1767350100","time_status":"0","league":{"id":"1083","name":"Israel Liga Alef South","cc":"il"},"home":{"id":"262115","name":"Maccabi Kiryat Gat","image_id":"509572","cc":"il"},"away":{"id":"46106","name":"Hapoel Herzliya","image_id":"7383","cc":"il"},"ss":null,"bet365_id":"185929028"},{"id":"11204928","sport_id":"1","time":"1767350400","time_status":"0","league":{"id":"1084","name":"Israel Liga Alef North","cc":"il"},"home":{"id":"9603","name":"Maccabi Achi Nazareth","image_id":"34526","cc":"il"},"o_home":{"id":"58133","name":"Maccabi Ahi Nazareth","image_id":"34526","cc":"il"},"away":{"id":"374323","name":"Hapoel Ironi Karmiel","image_id":"39530","cc":"il"},"ss":null,"round":"13","bet365_id":"185927437"},{"id":"11178188","sport_id":"1","time":"1767351600","time_status":"0","league":{"id":"1084","name":"Israel Liga Alef North","cc":"il"},"home":{"id":"374840","name":"Hapoel Ironi Arraba","image_id":"764298","cc":"il"},"away":{"id":"757056","name":"Maccabi Kiryat Ata Bialik","image_id":"65198","cc":"il"},"ss":null,"round":"13","bet365_id":"185927415"},{"id":"11178204","sport_id":"1","time":"1767351600","time_status":"0","league":{"id":"1084","name":"Israel Liga Alef North","cc":"il"},"home":{"id":"48247","name":"Hapoel Ironi Baqa Al Gharbiyye","image_id":"133600","cc":"il"},"away":{"id":"51868","name":"Hapoel Tirat Karmel","image_id":"401739","cc":"il"},"o_away":{"id":"184862","name":"Hapoel Tirat HaCarmel","image_id":"401739","cc":null},"ss":null,"round":"13","bet365_id":"185927427"},{"id":"11200678","sport_id":"1","time":"1767352500","time_status":"0","league":{"id":"1084","name":"Israel Liga Alef North","cc":"il"},"home":{"id":"9606","name":"Ironi Nesher","image_id":"61706","cc":"il"},"away":{"id":"187505","name":"FC Tzeirey Tamra","image_id":"422889","cc":"il"},"ss":null,"round":"13","bet365_id":"187235861"},{"id":"11204943","sport_id":"1","time":"1767352500","time_status":"0","league":{"id":"1313","name":"Israel Liga Bet North","cc":"il"},"home":{"id":"52108","name":"Hapoel Daliyat Al-Karmel","image_id":"39541","cc":"il"},"o_home":{"id":"177124","name":"Hapoel Dalyat El Carmel","image_id":"39541","cc":null},"away":{"id":"915322","name":"Hapoel Yafia","image_id":"1055327","cc":"il"},"ss":null,"bet365_id":"187298609"},{"id":"11196129","sport_id":"1","time":"1767353400","time_status":"0","league":{"id":"2369","name":"Syria Division 1","cc":"sy"},"home":{"id":"177710","name":"Al Ittihad Aleppo","image_id":"40652","cc":"sy"},"away":{"id":"1233307","name":"Damascus Al-Ahli","image_id":"35891","cc":"sy"},"ss":null,"round":"3"},{"id":"11196130","sport_id":"1","time":"1767353400","time_status":"0","league":{"id":"2369","name":"Syria Division 1","cc":"sy"},"home":{"id":"178455","name":"Al-Shorta Damascus","image_id":"362456","cc":"sy"},"away":{"id":"308204","name":"Al Futowa","image_id":"328079","cc":"sy"},"ss":null,"round":"3"},{"id":"11196141","sport_id":"1","time":"1767353400","time_status":"0","league":{"id":"2369","name":"Syria Division 1","cc":"sy"},"home":{"id":"237457","name":"Al Taliya SC","image_id":"186006","cc":"sy"},"away":{"id":"254050","name":"Al Wathba SC","image_id":"388276","cc":"sy"},"ss":null,"round":"3"},{"id":"11205131","sport_id":"1","time":"1767353400","time_status":"0","league":{"id":"1310","name":"Israel Liga Bet South","cc":"il"},"home":{"id":"48395","name":"Hapoel Kfar Qasm Shuaa","image_id":"61698","cc":"il"},"o_home":{"id":"185797","name":"Hapoel Kafr Qasim Shouaa","image_id":"61698","cc":null},"away":{"id":"1235186","name":"Bnei Jaljulia","image_id":null,"cc":null},"ss":null,"bet365_id":"187301902"},{"id":"11205791","sport_id":"1","time":"1767353700","time_status":"0","league":{"id":"12352","name":"Oman U21 Championship","cc":"om"},"home":{"id":"1231920","name":"Al Seeb U21","image_id":null,"cc":null},"away":{"id":"241664","name":"Salalah SC U21","image_id":null,"cc":null},"ss":null,"bet365_id":"187161266"},{"id":"11205804","sport_id":"1","time":"1767354000","time_status":"0","league":{"id":"12352","name":"Oman U21 Championship","cc":"om"},"home":{"id":"247034","name":"Al-Suwaiq U21","image_id":null,"cc":null},"away":{"id":"1233520","name":"Bidiyah U21","image_id":null,"cc":null},"ss":null,"bet365_id":"187161273"},{"id":"11146987","sport_id":"1","time":"1767354300","time_status":"0","league":{"id":"3237","name":"Brazil Sao Paulo Youth Cup","cc":"br"},"home":{"id":"1231521","name":"EC Meia Noite SP U20","image_id":"1312954","cc":"br"},"away":{"id":"1231124","name":"AE Real U20","image_id":"1312956","cc":"br"},"ss":null,"round":"1"},{"id":"11178199","sport_id":"1","time":"1767355200","time_status":"0","league":{"id":"1084","name":"Israel Liga Alef North","cc":"il"},"home":{"id":"182407","name":"Maccabi Nujeidat Ahmed","image_id":"543961","cc":"il"},"away":{"id":"46747","name":"Hapoel Umm al-Fahm","image_id":"86306","cc":"il"},"ss":null,"round":"13","bet365_id":"185927452"},{"id":"11204942","sport_id":"1","time":"1767355200","time_status":"0","league":{"id":"1313","name":"Israel Liga Bet North","cc":"il"},"home":{"id":"48137","name":"Tzeirei Kfar Kanna","image_id":"388294","cc":"il"},"away":{"id":"56204","name":"Hapoel Bnei Jat United","image_id":"237388","cc":"il"},"o_away":{"id":"82815","name":"Hapoel Ihud Bnei Jat","image_id":"237388","cc":null},"ss":null,"bet365_id":"187298516"},{"id":"11128605","sport_id":"1","time":"1767357000","time_status":"0","league":{"id":"6814","name":"Egypt Division 2","cc":"eg"},"home":{"id":"774531","name":"Proxy SC","image_id":"998831","cc":"eg"},"away":{"id":"45898","name":"El Daklyeh","image_id":"58317","cc":"eg"},"ss":null,"round":"17","bet365_id":"186930189"},{"id":"11128608","sport_id":"1","time":"1767357000","time_status":"0","league":{"id":"6814","name":"Egypt Division 2","cc":"eg"},"home":{"id":"378340","name":"La Viena FC","image_id":"775024","cc":"eg"},"away":{"id":"69958","name":"El Seka El Hadid","image_id":"307068","cc":"eg"},"ss":null,"round":"17","bet365_id":"187164367"}]} \ No newline at end of file +{ + "success": 1, + "pager": { + "page": 1, + "per_page": 50, + "total": 118 + }, + "results": [ + { + "id": "11205969", + "sport_id": "1", + "time": "1767312000", + "time_status": "0", + "league": { + "id": "32086", + "name": "Sierra Leone Premier League", + "cc": "sl" + }, + "home": { + "id": "807038", + "name": "Luawa FC", + "image_id": "976023", + "cc": "sl" + }, + "away": { + "id": "1107248", + "name": "Bullom Stars", + "image_id": "1227141", + "cc": "sl" + }, + "ss": null, + "bet365_id": "187264995" + }, + { + "id": "11204558", + "sport_id": "1", + "time": "1767324600", + "time_status": "0", + "league": { + "id": "3726", + "name": "India League Women", + "cc": "in" + }, + "home": { + "id": "1232296", + "name": "Gokulam Kerala FC (W)", + "image_id": "417727", + "cc": "in" + }, + "away": { + "id": "1233191", + "name": "Garhwal United (W)", + "image_id": "1250925", + "cc": "in" + }, + "ss": null, + "bet365_id": "187151600" + }, + { + "id": "11204559", + "sport_id": "1", + "time": "1767324600", + "time_status": "0", + "league": { + "id": "3726", + "name": "India League Women", + "cc": "in" + }, + "home": { + "id": "1176727", + "name": "Kickstart Karnataka FC (W)", + "image_id": "678415", + "cc": "in" + }, + "away": { + "id": "1231917", + "name": "Sribhumi FC (W)", + "image_id": "676603", + "cc": "in" + }, + "ss": null, + "bet365_id": "187151605" + }, + { + "id": "11204534", + "sport_id": "1", + "time": "1767331800", + "time_status": "0", + "league": { + "id": "14959", + "name": "India Delhi Senior Division", + "cc": "in" + }, + "home": { + "id": "270701", + "name": "Jaguar FC (India)", + "image_id": "303564", + "cc": "in" + }, + "o_home": { + "id": "236714", + "name": "Jaguar FC", + "image_id": "430845", + "cc": "au" + }, + "away": { + "id": "1128257", + "name": "M2M FC", + "image_id": "1245746", + "cc": "in" + }, + "ss": null, + "bet365_id": "187151505" + }, + { + "id": "11204544", + "sport_id": "1", + "time": "1767339000", + "time_status": "0", + "league": { + "id": "42582", + "name": "India Bengal Super League", + "cc": "in" + }, + "home": { + "id": "1234888", + "name": "Howrah Hooghly Warriors", + "image_id": "1313608", + "cc": "in" + }, + "away": { + "id": "1235171", + "name": "JHR Royal City FC", + "image_id": null, + "cc": null + }, + "ss": null, + "bet365_id": "187149267" + }, + { + "id": "11202121", + "sport_id": "1", + "time": "1767340800", + "time_status": "0", + "league": { + "id": "42027", + "name": "Algeria U20 League", + "cc": "dz" + }, + "home": { + "id": "1213704", + "name": "GC Mascara U20", + "image_id": "1304486", + "cc": "dz" + }, + "away": { + "id": "1235068", + "name": "MB Ain Hadjar U20", + "image_id": null, + "cc": null + }, + "ss": null, + "bet365_id": "187233071" + }, + { + "id": "11202156", + "sport_id": "1", + "time": "1767340800", + "time_status": "0", + "league": { + "id": "834", + "name": "Algeria Division 1", + "cc": "dz" + }, + "home": { + "id": "27180", + "name": "JS Kabylie", + "image_id": "42202", + "cc": "dz" + }, + "away": { + "id": "46305", + "name": "MC Alger", + "image_id": "42204", + "cc": "dz" + }, + "ss": null, + "bet365_id": "187233073" + }, + { + "id": "11204655", + "sport_id": "1", + "time": "1767340800", + "time_status": "0", + "league": { + "id": "42027", + "name": "Algeria U20 League", + "cc": "dz" + }, + "home": { + "id": "1213704", + "name": "GC Mascara U20", + "image_id": "1304486", + "cc": "dz" + }, + "away": { + "id": "1210732", + "name": "Mb Ain Hdjer U20", + "image_id": "1302480", + "cc": "dz" + }, + "ss": null + }, + { + "id": "10733545", + "sport_id": "1", + "time": "1767342600", + "time_status": "0", + "league": { + "id": "820", + "name": "Bangladesh Premier League", + "cc": "bd" + }, + "home": { + "id": "48294", + "name": "Brothers Union", + "image_id": "336965", + "cc": "bd" + }, + "away": { + "id": "48560", + "name": "Mohammedan Dhaka", + "image_id": "275093", + "cc": "bd" + }, + "ss": null, + "round": "9", + "bet365_id": "187155183" + }, + { + "id": "11204535", + "sport_id": "1", + "time": "1767342600", + "time_status": "0", + "league": { + "id": "14959", + "name": "India Delhi Senior Division", + "cc": "in" + }, + "home": { + "id": "177885", + "name": "Ahbab FC", + "image_id": "396446", + "cc": "in" + }, + "away": { + "id": "270807", + "name": "Rangers SC", + "image_id": "561390", + "cc": "in" + }, + "ss": null, + "bet365_id": "187159249" + }, + { + "id": "10650729", + "sport_id": "1", + "time": "1767342900", + "time_status": "0", + "league": { + "id": "1727", + "name": "Australia A-League", + "cc": "au" + }, + "home": { + "id": "50643", + "name": "Melbourne Victory", + "image_id": "5970", + "cc": "au" + }, + "away": { + "id": "2463", + "name": "Perth Glory", + "image_id": "2945", + "cc": "au" + }, + "ss": null, + "round": "11", + "bet365_id": "185933007" + }, + { + "id": "11202146", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "36349", + "name": "Algeria Elite Championship Women", + "cc": "dz" + }, + "home": { + "id": "1203504", + "name": "Afak Relizane (W)", + "image_id": "509986", + "cc": "dz" + }, + "away": { + "id": "1213182", + "name": "CF Akbou (W)", + "image_id": "388558", + "cc": "dz" + }, + "ss": null, + "bet365_id": "187207243" + }, + { + "id": "11202147", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "36349", + "name": "Algeria Elite Championship Women", + "cc": "dz" + }, + "home": { + "id": "1216683", + "name": "CR Belouizdad (W)", + "image_id": "1084372", + "cc": "dz" + }, + "away": { + "id": "1216682", + "name": "ALS Batna (W)", + "image_id": "543765", + "cc": "dz" + }, + "ss": null, + "bet365_id": "187233075" + }, + { + "id": "11202148", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "36349", + "name": "Algeria Elite Championship Women", + "cc": "dz" + }, + "home": { + "id": "1213181", + "name": "FC Bejaia (W)", + "image_id": "388556", + "cc": "dz" + }, + "away": { + "id": "1224160", + "name": "RS Tissemsilt (W)", + "image_id": null, + "cc": null + }, + "ss": null, + "bet365_id": "187233080" + }, + { + "id": "11204461", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "36349", + "name": "Algeria Elite Championship Women", + "cc": "dz" + }, + "home": { + "id": "1218636", + "name": "JS Kabylie (W)", + "image_id": "1099083", + "cc": "dz" + }, + "away": { + "id": "1203506", + "name": "CEA Setif (W)", + "image_id": "1100131", + "cc": "dz" + }, + "ss": null, + "bet365_id": "187298187" + }, + { + "id": "11204939", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "1313", + "name": "Israel Liga Bet North", + "cc": "il" + }, + "home": { + "id": "184441", + "name": "Netanya Kolet", + "image_id": null, + "cc": null + }, + "away": { + "id": "1084395", + "name": "SC Mashhad", + "image_id": "1188635", + "cc": "il" + }, + "ss": null, + "bet365_id": "187207918" + }, + { + "id": "11204940", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "1313", + "name": "Israel Liga Bet North", + "cc": "il" + }, + "home": { + "id": "54346", + "name": "Maccabi Ahi Iksal", + "image_id": "391614", + "cc": "il" + }, + "away": { + "id": "950487", + "name": "FC Tirat HaCarmel", + "image_id": "786158", + "cc": "il" + }, + "o_away": { + "id": "373422", + "name": "MS Tirat HaCarmel", + "image_id": "786158", + "cc": "il" + }, + "ss": null, + "bet365_id": "187252667" + }, + { + "id": "11204941", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "1313", + "name": "Israel Liga Bet North", + "cc": "il" + }, + "home": { + "id": "1194222", + "name": "FC Kababir", + "image_id": null, + "cc": null + }, + "away": { + "id": "1084328", + "name": "Tzeirey Haifa SC", + "image_id": null, + "cc": null + }, + "ss": null, + "bet365_id": "187254145" + }, + { + "id": "11205045", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "1310", + "name": "Israel Liga Bet South", + "cc": "il" + }, + "home": { + "id": "49450", + "name": "Maccabi Ironi Kfar Yona", + "image_id": "39614", + "cc": "il" + }, + "away": { + "id": "1046054", + "name": "Beitar Kfar Saba", + "image_id": "39518", + "cc": "il" + }, + "o_away": { + "id": "48411", + "name": "Beitar Kfar Saba Shlomi", + "image_id": "39518", + "cc": "il" + }, + "ss": null, + "bet365_id": "187207916" + }, + { + "id": "11205128", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "1310", + "name": "Israel Liga Bet South", + "cc": "il" + }, + "home": { + "id": "1187812", + "name": "Maccabi Beer Yaakov", + "image_id": "1055291", + "cc": "il" + }, + "away": { + "id": "46068", + "name": "Maccabi Ironi Netivot", + "image_id": "39520", + "cc": "il" + }, + "ss": null, + "bet365_id": "187160973" + }, + { + "id": "11205129", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "1310", + "name": "Israel Liga Bet South", + "cc": "il" + }, + "home": { + "id": "1191013", + "name": "Beitar Tel Aviv Holon", + "image_id": "36264", + "cc": "il" + }, + "o_home": { + "id": "301202", + "name": "Beitar Tel Aviv Bat Yam", + "image_id": "36264", + "cc": "il" + }, + "away": { + "id": "46064", + "name": "AS Holon Mor", + "image_id": "300212", + "cc": "il" + }, + "ss": null, + "bet365_id": "187235875" + }, + { + "id": "11206286", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "13797", + "name": "Myanmar League 2", + "cc": "mm" + }, + "home": { + "id": "1170930", + "name": "YB United FC", + "image_id": "1277338", + "cc": "mm" + }, + "away": { + "id": "259290", + "name": "University FC", + "image_id": "537487", + "cc": "mm" + }, + "ss": null, + "bet365_id": "187161124" + }, + { + "id": "11206287", + "sport_id": "1", + "time": "1767344400", + "time_status": "0", + "league": { + "id": "13797", + "name": "Myanmar League 2", + "cc": "mm" + }, + "home": { + "id": "1170823", + "name": "Yangon City", + "image_id": "1277336", + "cc": "mm" + }, + "away": { + "id": "260312", + "name": "Silver Stars", + "image_id": "537489", + "cc": "mm" + }, + "ss": null, + "bet365_id": "187161132" + }, + { + "id": "11204560", + "sport_id": "1", + "time": "1767346200", + "time_status": "0", + "league": { + "id": "3726", + "name": "India League Women", + "cc": "in" + }, + "home": { + "id": "1231915", + "name": "Nita FA (W)", + "image_id": "1118417", + "cc": "in" + }, + "away": { + "id": "1228473", + "name": "East Bengal FC (W)", + "image_id": "1007757", + "cc": "in" + }, + "o_away": { + "id": "1219330", + "name": "East Bengal Club (W)", + "image_id": "1007757", + "cc": "in" + }, + "ss": null, + "bet365_id": "187159363" + }, + { + "id": "11204591", + "sport_id": "1", + "time": "1767346200", + "time_status": "0", + "league": { + "id": "2750", + "name": "India Mumbai Elite League", + "cc": "in" + }, + "home": { + "id": "197218", + "name": "Millat FC", + "image_id": "548689", + "cc": "in" + }, + "away": { + "id": "321306", + "name": "Mumbai Ultras FC", + "image_id": null, + "cc": "in" + }, + "ss": null, + "bet365_id": "187298338" + }, + { + "id": "11178195", + "sport_id": "1", + "time": "1767348000", + "time_status": "0", + "league": { + "id": "1083", + "name": "Israel Liga Alef South", + "cc": "il" + }, + "home": { + "id": "44567", + "name": "Hapoel Nir Ramat Hasharon", + "image_id": "36274", + "cc": "il" + }, + "away": { + "id": "48396", + "name": "Hapoel Azor", + "image_id": "61700", + "cc": "il" + }, + "ss": null, + "round": "13" + }, + { + "id": "11204921", + "sport_id": "1", + "time": "1767348000", + "time_status": "0", + "league": { + "id": "1083", + "name": "Israel Liga Alef South", + "cc": "il" + }, + "home": { + "id": "44567", + "name": "Hapoel Nir Ramat Hasharon", + "image_id": "36274", + "cc": "il" + }, + "away": { + "id": "48396", + "name": "Hapoel Azor", + "image_id": "61700", + "cc": "il" + }, + "ss": null, + "bet365_id": "185929040" + }, + { + "id": "11205130", + "sport_id": "1", + "time": "1767348000", + "time_status": "0", + "league": { + "id": "1310", + "name": "Israel Liga Bet South", + "cc": "il" + }, + "home": { + "id": "769549", + "name": "Sderot", + "image_id": "954101", + "cc": "il" + }, + "away": { + "id": "187741", + "name": "Beitar Ironi Kiryat Gat", + "image_id": "385158", + "cc": "il" + }, + "ss": null, + "bet365_id": "187298692" + }, + { + "id": "11178193", + "sport_id": "1", + "time": "1767349800", + "time_status": "0", + "league": { + "id": "1083", + "name": "Israel Liga Alef South", + "cc": "il" + }, + "home": { + "id": "46112", + "name": "Maccabi Yavne", + "image_id": "61708", + "cc": "il" + }, + "away": { + "id": "9539", + "name": "FC Beitar Yavne", + "image_id": "388148", + "cc": "il" + }, + "ss": null, + "round": "13" + }, + { + "id": "11204623", + "sport_id": "1", + "time": "1767349800", + "time_status": "0", + "league": { + "id": "6655", + "name": "Iran Div 2", + "cc": "ir" + }, + "home": { + "id": "177078", + "name": "Shahrdari Mahshahr", + "image_id": "299672", + "cc": "ir" + }, + "away": { + "id": "929948", + "name": "KIA Football Academy", + "image_id": "1067536", + "cc": "ir" + }, + "ss": null, + "bet365_id": "187237470" + }, + { + "id": "11204624", + "sport_id": "1", + "time": "1767349800", + "time_status": "0", + "league": { + "id": "6655", + "name": "Iran Div 2", + "cc": "ir" + }, + "home": { + "id": "1083844", + "name": "Omid Tehran", + "image_id": "1216251", + "cc": "ir" + }, + "away": { + "id": "175911", + "name": "Sepidrood Rasht", + "image_id": "361860", + "cc": "ir" + }, + "ss": null, + "bet365_id": "187237473" + }, + { + "id": "11204920", + "sport_id": "1", + "time": "1767349800", + "time_status": "0", + "league": { + "id": "1083", + "name": "Israel Liga Alef South", + "cc": "il" + }, + "home": { + "id": "46112", + "name": "Maccabi Yavne", + "image_id": "61708", + "cc": "il" + }, + "away": { + "id": "9539", + "name": "FC Beitar Yavne", + "image_id": "388148", + "cc": "il" + }, + "ss": null, + "bet365_id": "185929032" + }, + { + "id": "11178192", + "sport_id": "1", + "time": "1767350100", + "time_status": "0", + "league": { + "id": "1083", + "name": "Israel Liga Alef South", + "cc": "il" + }, + "home": { + "id": "262115", + "name": "Maccabi Kiryat Gat", + "image_id": "509572", + "cc": "il" + }, + "away": { + "id": "46106", + "name": "Hapoel Herzliya", + "image_id": "7383", + "cc": "il" + }, + "ss": null, + "round": "13" + }, + { + "id": "11204919", + "sport_id": "1", + "time": "1767350100", + "time_status": "0", + "league": { + "id": "1083", + "name": "Israel Liga Alef South", + "cc": "il" + }, + "home": { + "id": "262115", + "name": "Maccabi Kiryat Gat", + "image_id": "509572", + "cc": "il" + }, + "away": { + "id": "46106", + "name": "Hapoel Herzliya", + "image_id": "7383", + "cc": "il" + }, + "ss": null, + "bet365_id": "185929028" + }, + { + "id": "11204928", + "sport_id": "1", + "time": "1767350400", + "time_status": "0", + "league": { + "id": "1084", + "name": "Israel Liga Alef North", + "cc": "il" + }, + "home": { + "id": "9603", + "name": "Maccabi Achi Nazareth", + "image_id": "34526", + "cc": "il" + }, + "o_home": { + "id": "58133", + "name": "Maccabi Ahi Nazareth", + "image_id": "34526", + "cc": "il" + }, + "away": { + "id": "374323", + "name": "Hapoel Ironi Karmiel", + "image_id": "39530", + "cc": "il" + }, + "ss": null, + "round": "13", + "bet365_id": "185927437" + }, + { + "id": "11178188", + "sport_id": "1", + "time": "1767351600", + "time_status": "0", + "league": { + "id": "1084", + "name": "Israel Liga Alef North", + "cc": "il" + }, + "home": { + "id": "374840", + "name": "Hapoel Ironi Arraba", + "image_id": "764298", + "cc": "il" + }, + "away": { + "id": "757056", + "name": "Maccabi Kiryat Ata Bialik", + "image_id": "65198", + "cc": "il" + }, + "ss": null, + "round": "13", + "bet365_id": "185927415" + }, + { + "id": "11178204", + "sport_id": "1", + "time": "1767351600", + "time_status": "0", + "league": { + "id": "1084", + "name": "Israel Liga Alef North", + "cc": "il" + }, + "home": { + "id": "48247", + "name": "Hapoel Ironi Baqa Al Gharbiyye", + "image_id": "133600", + "cc": "il" + }, + "away": { + "id": "51868", + "name": "Hapoel Tirat Karmel", + "image_id": "401739", + "cc": "il" + }, + "o_away": { + "id": "184862", + "name": "Hapoel Tirat HaCarmel", + "image_id": "401739", + "cc": null + }, + "ss": null, + "round": "13", + "bet365_id": "185927427" + }, + { + "id": "11200678", + "sport_id": "1", + "time": "1767352500", + "time_status": "0", + "league": { + "id": "1084", + "name": "Israel Liga Alef North", + "cc": "il" + }, + "home": { + "id": "9606", + "name": "Ironi Nesher", + "image_id": "61706", + "cc": "il" + }, + "away": { + "id": "187505", + "name": "FC Tzeirey Tamra", + "image_id": "422889", + "cc": "il" + }, + "ss": null, + "round": "13", + "bet365_id": "187235861" + }, + { + "id": "11204943", + "sport_id": "1", + "time": "1767352500", + "time_status": "0", + "league": { + "id": "1313", + "name": "Israel Liga Bet North", + "cc": "il" + }, + "home": { + "id": "52108", + "name": "Hapoel Daliyat Al-Karmel", + "image_id": "39541", + "cc": "il" + }, + "o_home": { + "id": "177124", + "name": "Hapoel Dalyat El Carmel", + "image_id": "39541", + "cc": null + }, + "away": { + "id": "915322", + "name": "Hapoel Yafia", + "image_id": "1055327", + "cc": "il" + }, + "ss": null, + "bet365_id": "187298609" + }, + { + "id": "11196129", + "sport_id": "1", + "time": "1767353400", + "time_status": "0", + "league": { + "id": "2369", + "name": "Syria Division 1", + "cc": "sy" + }, + "home": { + "id": "177710", + "name": "Al Ittihad Aleppo", + "image_id": "40652", + "cc": "sy" + }, + "away": { + "id": "1233307", + "name": "Damascus Al-Ahli", + "image_id": "35891", + "cc": "sy" + }, + "ss": null, + "round": "3" + }, + { + "id": "11196130", + "sport_id": "1", + "time": "1767353400", + "time_status": "0", + "league": { + "id": "2369", + "name": "Syria Division 1", + "cc": "sy" + }, + "home": { + "id": "178455", + "name": "Al-Shorta Damascus", + "image_id": "362456", + "cc": "sy" + }, + "away": { + "id": "308204", + "name": "Al Futowa", + "image_id": "328079", + "cc": "sy" + }, + "ss": null, + "round": "3" + }, + { + "id": "11196141", + "sport_id": "1", + "time": "1767353400", + "time_status": "0", + "league": { + "id": "2369", + "name": "Syria Division 1", + "cc": "sy" + }, + "home": { + "id": "237457", + "name": "Al Taliya SC", + "image_id": "186006", + "cc": "sy" + }, + "away": { + "id": "254050", + "name": "Al Wathba SC", + "image_id": "388276", + "cc": "sy" + }, + "ss": null, + "round": "3" + }, + { + "id": "11205131", + "sport_id": "1", + "time": "1767353400", + "time_status": "0", + "league": { + "id": "1310", + "name": "Israel Liga Bet South", + "cc": "il" + }, + "home": { + "id": "48395", + "name": "Hapoel Kfar Qasm Shuaa", + "image_id": "61698", + "cc": "il" + }, + "o_home": { + "id": "185797", + "name": "Hapoel Kafr Qasim Shouaa", + "image_id": "61698", + "cc": null + }, + "away": { + "id": "1235186", + "name": "Bnei Jaljulia", + "image_id": null, + "cc": null + }, + "ss": null, + "bet365_id": "187301902" + }, + { + "id": "11205791", + "sport_id": "1", + "time": "1767353700", + "time_status": "0", + "league": { + "id": "12352", + "name": "Oman U21 Championship", + "cc": "om" + }, + "home": { + "id": "1231920", + "name": "Al Seeb U21", + "image_id": null, + "cc": null + }, + "away": { + "id": "241664", + "name": "Salalah SC U21", + "image_id": null, + "cc": null + }, + "ss": null, + "bet365_id": "187161266" + }, + { + "id": "11205804", + "sport_id": "1", + "time": "1767354000", + "time_status": "0", + "league": { + "id": "12352", + "name": "Oman U21 Championship", + "cc": "om" + }, + "home": { + "id": "247034", + "name": "Al-Suwaiq U21", + "image_id": null, + "cc": null + }, + "away": { + "id": "1233520", + "name": "Bidiyah U21", + "image_id": null, + "cc": null + }, + "ss": null, + "bet365_id": "187161273" + }, + { + "id": "11146987", + "sport_id": "1", + "time": "1767354300", + "time_status": "0", + "league": { + "id": "3237", + "name": "Brazil Sao Paulo Youth Cup", + "cc": "br" + }, + "home": { + "id": "1231521", + "name": "EC Meia Noite SP U20", + "image_id": "1312954", + "cc": "br" + }, + "away": { + "id": "1231124", + "name": "AE Real U20", + "image_id": "1312956", + "cc": "br" + }, + "ss": null, + "round": "1" + }, + { + "id": "11178199", + "sport_id": "1", + "time": "1767355200", + "time_status": "0", + "league": { + "id": "1084", + "name": "Israel Liga Alef North", + "cc": "il" + }, + "home": { + "id": "182407", + "name": "Maccabi Nujeidat Ahmed", + "image_id": "543961", + "cc": "il" + }, + "away": { + "id": "46747", + "name": "Hapoel Umm al-Fahm", + "image_id": "86306", + "cc": "il" + }, + "ss": null, + "round": "13", + "bet365_id": "185927452" + }, + { + "id": "11204942", + "sport_id": "1", + "time": "1767355200", + "time_status": "0", + "league": { + "id": "1313", + "name": "Israel Liga Bet North", + "cc": "il" + }, + "home": { + "id": "48137", + "name": "Tzeirei Kfar Kanna", + "image_id": "388294", + "cc": "il" + }, + "away": { + "id": "56204", + "name": "Hapoel Bnei Jat United", + "image_id": "237388", + "cc": "il" + }, + "o_away": { + "id": "82815", + "name": "Hapoel Ihud Bnei Jat", + "image_id": "237388", + "cc": null + }, + "ss": null, + "bet365_id": "187298516" + }, + { + "id": "11128605", + "sport_id": "1", + "time": "1767357000", + "time_status": "0", + "league": { + "id": "6814", + "name": "Egypt Division 2", + "cc": "eg" + }, + "home": { + "id": "774531", + "name": "Proxy SC", + "image_id": "998831", + "cc": "eg" + }, + "away": { + "id": "45898", + "name": "El Daklyeh", + "image_id": "58317", + "cc": "eg" + }, + "ss": null, + "round": "17", + "bet365_id": "186930189" + }, + { + "id": "11128608", + "sport_id": "1", + "time": "1767357000", + "time_status": "0", + "league": { + "id": "6814", + "name": "Egypt Division 2", + "cc": "eg" + }, + "home": { + "id": "378340", + "name": "La Viena FC", + "image_id": "775024", + "cc": "eg" + }, + "away": { + "id": "69958", + "name": "El Seka El Hadid", + "image_id": "307068", + "cc": "eg" + }, + "ss": null, + "round": "17", + "bet365_id": "187164367" + } + ] +} \ No newline at end of file diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index 551193c2..17076bed 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -16,7 +16,9 @@ use App\Models\MultilineClient; use CodeWithKyrian\FilamentDateRange\Forms\Components\DateRangePicker; use Filament\Actions\Action; use Filament\Actions\ActionGroup; +use Filament\Actions\BulkActionGroup; use Filament\Actions\DeleteAction; +use Filament\Actions\DeleteBulkAction; use Filament\Actions\EditAction; use Filament\Forms\Components\Select; use Filament\Schemas\Components\Utilities\Get; @@ -133,7 +135,7 @@ class EventsTable ->tooltip(fn ($record) => $record->id) ->visibleFrom('lg'), - // MatchIds::make('match_ids')->grow(false)->visibleFrom('xl'), + MatchIds::make('match_ids')->grow(false)->visibleFrom('xl'), TextColumn::make('starttime') ->label('Start') @@ -306,6 +308,10 @@ class EventsTable ])->iconButton() ->icon('heroicon-m-ellipsis-vertical') ->color('primary'), + ])->toolbarActions([ + BulkActionGroup::make([ + DeleteBulkAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')), + ]), ]); } } diff --git a/app/Livewire/MapperLeft.php b/app/Livewire/MapperLeft.php index b245f01f..ee02bd54 100644 --- a/app/Livewire/MapperLeft.php +++ b/app/Livewire/MapperLeft.php @@ -4,6 +4,7 @@ namespace App\Livewire; use App\Filament\Tables\Columns\MapperLeftColumn; use App\Mapper\LoadEvents; +use App\Mapper\StoreMapped; use App\Models\CompetitionGroup; use App\Models\Country; use App\Models\Event; @@ -31,6 +32,8 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable use InteractsWithSchemas; use InteractsWithTable; + public $elements_swopped = false; + protected $listeners = [ 'reload_data' => '$refresh', ]; @@ -74,7 +77,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable ->searchable() ->options(function (Get $get) { if ($get('country_id')) { - $res = Event::query()->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->where('country_id', $get('country_id'))->groupBy('competition_group_id')->pluck('competition_group_id')->toArray(); + $res = Event::query()->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->whereIn('country_id', $get('country_id'))->groupBy('competition_group_id')->pluck('competition_group_id')->toArray(); } else { $res = Event::query()->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->groupBy('competition_group_id')->pluck('competition_group_id')->toArray(); } @@ -123,17 +126,29 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable ]); } + public function toggle() + { + $this->elements_swopped = ! $this->elements_swopped; + } + public function leftAction(): Action { return Action::make('left') ->modalHeading('Event Mapper') ->modalContent(function (array $arguments) { - $event = Event::where('id', $arguments['match_id'])->first(); + + $event = Event::where('id', $arguments['id'])->first(); $mapper = Mapper::where('event_id', $arguments['event_id'])->first(); - return view('livewire.confirm-mapping', ['event' => $event, 'mapper' => $mapper, 'mappermode' => 'linear']); + return view('livewire.confirm-mapping', ['event' => $event, 'mapper' => $mapper]); }) + ->action(function ($arguments) { + StoreMapped::store($arguments, $this->elements_swopped); + }) + ->closeModalByEscaping(false) + ->modalCloseButton(false) + ->closeModalByClickingAway(false) ->modalAlignment(Alignment::Center) ->modalFooterActionsAlignment(Alignment::Center) ->modalWidth('2xl') diff --git a/app/Livewire/MapperRight.php b/app/Livewire/MapperRight.php index 4def42a8..753c4a64 100644 --- a/app/Livewire/MapperRight.php +++ b/app/Livewire/MapperRight.php @@ -4,12 +4,15 @@ namespace App\Livewire; use App\Filament\Tables\Columns\MapperRightColumn; use App\Mapper\LoadProvider; +use App\Mapper\StoreMapped; +use App\Models\Country; use App\Models\Event; use App\Models\Mapper; use Filament\Actions\Action; use Filament\Actions\Concerns\InteractsWithActions; use Filament\Actions\Contracts\HasActions; use Filament\Forms\Components\Select; +use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Concerns\InteractsWithSchemas; use Filament\Schemas\Contracts\HasSchemas; use Filament\Support\Enums\Alignment; @@ -19,6 +22,8 @@ use Filament\Tables\Enums\FiltersLayout; use Filament\Tables\Filters\Filter; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Auth; use Livewire\Component; class MapperRight extends Component implements HasActions, HasSchemas, HasTable @@ -27,6 +32,8 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable use InteractsWithSchemas; use InteractsWithTable; + public $elements_swopped = false; + protected $listeners = [ 'reload_data' => '$refresh', ]; @@ -46,33 +53,45 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable ->placeholder('Country') ->hiddenLabel() ->label('') - ->relationship('country_betsapi', 'name') ->searchable() ->preload() ->multiple() ->columnSpan(2) ->live() + ->options(function () { + $res = Mapper::query()->where('sport_id', Auth::user()->sport_id)->where('provider_id', Auth::user()->provider_id)->where('starttime', '>', Carbon::now())->groupBy('group_cc')->pluck('group_cc')->toArray(); + + return Country::query()->whereIn('iso2', $res)->pluck('name', 'iso2'); + }) ->reactive() + ->afterStateUpdated(function (callable $set) { + $set('group_id', null); + }) ->placeholder('Country') ->label('Countries'), Select::make('group_id') ->placeholder('League') + ->label('Leagues') ->hiddenLabel() ->label('') - ->options(fn () => Mapper::groupBy('group_id')->pluck('group', 'group_id')) ->columnSpan(2) ->searchable() ->preload() ->multiple() - ->live() - ->placeholder('League') - ->label('Leagues'), + ->options(function (Get $get) { + if ($get('group_cc')) { + return Mapper::query()->where('sport_id', Auth::user()->sport_id)->where('provider_id', Auth::user()->provider_id)->where('starttime', '>', Carbon::now())->whereIn('group_cc', $get('group_cc'))->groupBy('group_id')->pluck('group', 'group_id')->toArray(); + } else { + return Mapper::query()->where('sport_id', Auth::user()->sport_id)->where('provider_id', Auth::user()->provider_id)->where('starttime', '>', Carbon::now())->groupBy('group_id')->pluck('group', 'group_id')->toArray(); + } + }) + ->live(), ]) ->query(function (Builder $query, array $data): Builder { return $query ->when( $data['group_cc'], - fn (Builder $query, $group_cc) => $query->where('group_cc', $group_cc) + fn (Builder $query, $group_cc) => $query->whereIn('group_cc', $group_cc) )->when( $data['group_id'], fn (Builder $query, $group_id) => $query->whereIn('group_id', $group_id) @@ -89,7 +108,6 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable ->hiddenLabel() ->color('gray') ->icon('heroicon-o-arrow-path') - // ->icon('phosphor-x') ->action(function (Component $livewire) { $livewire->resetTableFiltersForm(); // Clears all filters $this->tableSearch = ''; // Clears the main search bar @@ -97,16 +115,28 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable ]); } + public function toggle() + { + $this->elements_swopped = ! $this->elements_swopped; + } + public function rightAction(): Action { return Action::make('right') ->modalHeading('Event Mapper') ->modalContent(function (array $arguments) { - $event = Event::where('id', $arguments['match_id'])->first(); + + $event = Event::where('id', $arguments['id'])->first(); + $mapper = Mapper::where('event_id', $arguments['event_id'])->first(); - return view('livewire.confirm-mapping', ['event' => $event, 'mapper' => $mapper, 'mappermode' => 'linear']); + return view('livewire.confirm-mapping', ['event' => $event, 'mapper' => $mapper]); + })->action(function ($arguments) { + StoreMapped::store($arguments, $this->elements_swopped); }) + ->closeModalByEscaping(false) + ->modalCloseButton(false) + ->closeModalByClickingAway(false) ->modalAlignment(Alignment::Center) ->modalFooterActionsAlignment(Alignment::Center) ->modalWidth('2xl') diff --git a/app/Mapper/FindEvent.php b/app/Mapper/FindEvent.php index 5769b900..15702c8c 100644 --- a/app/Mapper/FindEvent.php +++ b/app/Mapper/FindEvent.php @@ -10,9 +10,14 @@ class FindEvent { public static function search($event, &$groups, &$elements) { - $event_id = $event['event_id']; + $betradar_id = $event['betradar_id'] ?? 0; + + $betsapi_id = $event['betsapi_id'] ?? 0; + + $bet365_id = $event['bet365_id'] ?? 0; + unset($event['event_id']); switch ($event['provider_id']) { @@ -40,8 +45,29 @@ class FindEvent Notice::note('unknown provider', 'r', 1); break; } + if ($match_id) { + Mapper::where('event_id', $event_id)->delete(); + + $event = Event::where('id', $match_id)->first(); + + $update_array = []; + + if ($betradar_id && ! $event->betradar_id) { + $update_array['betradar_id'] = $betradar_id; + } + if ($betsapi_id && ! $event->betsapi_id) { + $update_array['betsapi_id'] = $betsapi_id; + } + if ($bet365_id && ! $event->bet365_id) { + $update_array['bet365_id'] = $bet365_id; + } + + if ($update_array) { + Event::where('id', $match_id)->update($update_array); + exit; + } } else { $home_id = $elements[$event['home_id']] ?? 0; @@ -54,22 +80,37 @@ class FindEvent if ($home_id && $away_id && $cgid) { - $from = Carbon::createFromDate($startime)->remvoDay(); + $from = Carbon::createFromDate($startime)->subDay(); - $to = Carbon::createFromDate($starttime_period['end'])->subDay(); + $to = Carbon::createFromDate($startime)->addDay(); + + // dd($home_id, $away_id, $cgid, $from->toDateTimeString(), $to->toDateTimeString()); $match_id = Event::query() ->where('home_id', $home_id) ->where('away_id', $away_id) - ->where('competition_group_id', $competition_group_id) - ->where('starttime', '>', $from) - ->where('starttime', '<', $to) - ->value('id') - ->get(); + ->where('competition_group_id', $cgid) + ->where('starttime', '>', $from->toDateTimeString()) + ->where('starttime', '<', $to->toDateTimeString()) + ->value('id'); if ($match_id) { - Event::where('betsapi_id', (int) $betsapi_id)->update(['betradar_id' => $betradar_id, 'bwin_id' => $bwin_id]); + $update_array = []; + + if ($betradar_id) { + $update_array['betradar_id'] = $betradar_id; + } + if ($betsapi_id) { + $update_array['betsapi_id'] = $betsapi_id; + } + if ($bet365_id) { + $update_array['bet365_id'] = $bet365_id; + } + + if ($update_array) { + Event::where('id', $match_id)->update($update_array); + } switch ($event['provider_id']) { case 2: diff --git a/app/Mapper/StoreMapped.php b/app/Mapper/StoreMapped.php new file mode 100644 index 00000000..12423865 --- /dev/null +++ b/app/Mapper/StoreMapped.php @@ -0,0 +1,107 @@ +first(); + + $mapper = Mapper::where('event_id', $arguments['event_id'])->first(); + + /* + EVENT + "id" => 14039120 + "provider_id" => 1 + "betsapi_id" => 0 + "betradar_id" => 0 + "bet365_id" => 0 + "_1xbet_id" => 0 + "bwin_id" => 0 + "magnig_id" => 0 + "magken_id" => 0 + "lognig_id" => 0 + "logcol_id" => 0 + "starttime" => "2026-01-02 13:00:00" + "sport_id" => 1 + "country_id" => 365 + "group_id" => 177539 + "competition_group_id" => 141 + "home_id" => 6963 + "away_id" => 6844 + MAPPER + "id" => 1 + "event_id" => 11208805 + "sport_id" => 1 + "provider_id" => 2 + "starttime" => "2026-01-02 05:00:00" + "group" => "Indonesia Liga 4" + "group_id" => 39616 + "group_cc" => "ID" + "home" => "Boliyohuto FC" + "home_id" => 308421 + "home_cc" => "ID" + "away" => "Panipi Raya FC" + "away_id" => 308005 + "away_cc" => "ID" + "created_at" => "2026-01-02 06:33:20" + "updated_at" => "2026-01-02 06:33:20" + */ + + $ele = []; + $ele['sport_id'] = $event->sport_id; + $ele['provider_id'] = Auth::user()->provider_id; + $ele['element_id'] = $event->home_id ?? 0; + $ele['name'] = $mapper->home; + ElementProvider::updateOrCreate(['provider_element_id' => (int) $mapper->home_id], $ele); + + $ele = []; + $ele['sport_id'] = $event->sport_id; + $ele['provider_id'] = Auth::user()->provider_id; + $ele['element_id'] = $event->away_id ?? 0; + $ele['name'] = $mapper->away; + ElementProvider::updateOrCreate(['provider_element_id' => (int) $mapper->away_id], $ele); + + $group['sport_id'] = $event->sport_id; + $group['provider_id'] = Auth::user()->provider_id; + $group['competition_group_id'] = $event->competition_group_id; + $group['name'] = $mapper->group; + CompetitionGroupProvider::updateOrCreate(['provider_group_id' => (int) $mapper->group_id], $group); + + switch ($mapper->provider_id) { + case 2: + // BETSAPI + $event->betradar_id = $mapper->betradar_id ?? 0; + $event->betsapi_id = $mapper->event_id; + $event->bet365_id = $mapper->bet365_id ?? 0; + break; + case 3: + // MAGLOO KENIA + $event->magnig_id = $mapper->event_id; + break; + case 4: + // MAGLOO NIGERIA + $event->magken_id = $mapper->event_id; + break; + case 5: + // LOGIFUTUR NIGERA + $event->lognig_id = $mapper->event_id; + break; + case 6: + // LOGIFUTUR COLOMBIA + $event->logcol_id = $mapper->event_id; + break; + } + $event->save(); + + Mapper::where('event_id', $arguments['event_id'])->delete(); + } +} diff --git a/app/Models/Mapper.php b/app/Models/Mapper.php index 2b93cd75..d241d228 100644 --- a/app/Models/Mapper.php +++ b/app/Models/Mapper.php @@ -8,9 +8,11 @@ class Mapper extends Model { protected $fillable = [ 'event_id', - 'provider_id', + 'betradar_id', + 'betsapi_id', + 'bet365_id', 'sport_id', - 'tx_id', + 'provider_id', 'starttime', 'group', 'group_id', diff --git a/database/migrations/2025_12_19_111819_create_mappers_table.php b/database/migrations/2025_12_19_111819_create_mappers_table.php index ed540ecb..315c4904 100644 --- a/database/migrations/2025_12_19_111819_create_mappers_table.php +++ b/database/migrations/2025_12_19_111819_create_mappers_table.php @@ -14,6 +14,9 @@ return new class extends Migration Schema::create('mappers', function (Blueprint $table) { $table->id(); $table->integer('event_id')->index(); + $table->integer('betradar_id')->index(); + $table->integer('betsapi_id')->index(); + $table->integer('bet365_id')->index(); $table->integer('sport_id')->index(); $table->integer('provider_id')->default(0)->nullable()->index(); $table->dateTime('starttime')->nullable(); diff --git a/resources/views/filament/tables/columns/mapper-left-column.blade.php b/resources/views/filament/tables/columns/mapper-left-column.blade.php index 1e60bbb4..134c788b 100644 --- a/resources/views/filament/tables/columns/mapper-left-column.blade.php +++ b/resources/views/filament/tables/columns/mapper-left-column.blade.php @@ -10,7 +10,7 @@ const id = event.dataTransfer.getData('text/plain'); const target = event.target.closest('li'); if(document.getElementById(id).getAttribute('mapper') !=target.getAttribute('mapper')) - $wire.mountAction('left', { event_id: id, match_id: target.id });" + $wire.mountAction('left', { event_id: id, id: target.id });" draggable="true" mapper="left">
diff --git a/resources/views/filament/tables/columns/mapper-right-column.blade.php b/resources/views/filament/tables/columns/mapper-right-column.blade.php index 31e19ede..40de04e4 100644 --- a/resources/views/filament/tables/columns/mapper-right-column.blade.php +++ b/resources/views/filament/tables/columns/mapper-right-column.blade.php @@ -1,6 +1,6 @@ -
  • event_id }} +
  • event_id }} x-on:dragstart.self=" dragging = true; event.dataTransfer.effectAllowed = 'move'; @@ -11,7 +11,7 @@ const id = event.dataTransfer.getData('text/plain'); const target = event.target.closest('li'); if(document.getElementById(id).getAttribute('mapper') !=target.getAttribute('mapper')) - $wire.mountAction('right', { match_id: id, event_id: target.id });" + $wire.mountAction('right', { id: id, event_id: target.id });" draggable="true" mapper="right"> @include('filament.tables.columns.parts.move-botton') diff --git a/resources/views/livewire/confirm-mapping.blade.php b/resources/views/livewire/confirm-mapping.blade.php index a48e4805..f4e4b619 100644 --- a/resources/views/livewire/confirm-mapping.blade.php +++ b/resources/views/livewire/confirm-mapping.blade.php @@ -1,22 +1,80 @@ +@php + use Illuminate\Support\Carbon; + + $e = Carbon::parse($event->starttime); + $m = Carbon::parse($mapper->starttime); + + $seconds = $e->diffInSeconds($m); + + $diff = gmdate('H:i:s', $seconds); + + if ($seconds == 0) { + $color = 1; + } elseif ($seconds < 1800) { + $color = 2; + } elseif ($seconds < 7200) { + $color = 3; + } else { + $color = 4; + } + +@endphp +
    -
    -
    {{ $event->home->name }}
    +
    +
    +
    Startime Difference
    +
    +
    {{ $e->format('d-m-y H:i') }}
    + @switch($color) + @case(1) +
    {{ $diff }}
    + @break + + @case(2) +
    {{ $diff }}
    + @break + + @case(3) +
    {{ $diff }}
    + @break + + @case(4) +
    {{ $diff }}
    + @break + @endswitch +
    {{ $m->format('d-m-y H:i') }}
    +
    +
    + @if ($event->country?->iso2) + + @elseif($event->country?->icon) + + @endif +
    +
    {{ $event->country?->name }}
    +
    {{ $event->competition_group->name }}
    +
    + +
    {{ $event->home->name }}
    +
    -
    - -
    - +
    + +
    +
    -
    - +
    +
    -
    {{ $mapper->home }}
    -
    {{ $event->away->name }}
    +
    {{ $mapper->home }}
    -
    {{ $mapper->away }}
    +
    {{ $event->away->name }}
    + +
    {{ $mapper->away }}
    diff --git a/resources/views/livewire/top-menu-items.blade.php b/resources/views/livewire/top-menu-items.blade.php index 8ac0c1fe..4067aeb6 100644 --- a/resources/views/livewire/top-menu-items.blade.php +++ b/resources/views/livewire/top-menu-items.blade.php @@ -74,7 +74,8 @@ {{-- Event Mapper --}} - + Event Mapper