mapping search wip (stuck)
This commit is contained in:
1 parent
ea91af51fa
commit
b475d78f43
14 files changed
+126
-33
No files matched your search
@@ -47,14 +47,17 @@ class Bwin
|
||||
foreach ($data['results'] as $event) {
|
||||
|
||||
$betsapi_id = $event['our_event_id'] ?? 0;
|
||||
|
||||
$betradar_id = $event['BetRadarId'] ?? 0;
|
||||
|
||||
$bwin_id = $event['Id'] ?? 0;
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(["Betsapi ID : $betsapi_id", "Betradar ID : $betradar_id", "Bwin ID : $bwin_id"]);
|
||||
}
|
||||
if ($betradar_id && $betsapi_id) {
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(["Betsapi ID : $betsapi_id", "Betradar ID : $betradar_id", "Bwin ID : $bwin_id"]);
|
||||
}
|
||||
|
||||
if ($betradar_id) {
|
||||
Event::where('betsapi_id', (int) $betsapi_id)->update(['betradar_id' => $betradar_id, 'bwin_id' => $bwin_id]);
|
||||
|
||||
Mapper::where('event_id', $betsapi_id)->delete();
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Betsapi;
|
||||
|
||||
use App\Console\Commands\Curl;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Event;
|
||||
use App\Models\Mapper;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
@@ -33,7 +34,7 @@ class Fixtures
|
||||
$total = 1;
|
||||
foreach ($sportmap as $sport_id => $betsapi_sport_id) {
|
||||
|
||||
$sport_url = str_replace('###sport_id###', $sport_id, $base_url);
|
||||
$sport_url = str_replace('###sport_id###', $betsapi_sport_id, $base_url);
|
||||
|
||||
$page = 1;
|
||||
while ($page <= $total) {
|
||||
@@ -71,8 +72,13 @@ class Fixtures
|
||||
'group_id' => (int) $row['league']['id'] ?? 0,
|
||||
'group_cc' => strtoupper($row['league']['cc']) ?? '',
|
||||
];
|
||||
|
||||
Mapper::updateOrCreate(['event_id' => (int) $row['id']], $event);
|
||||
$event_id = (int) $row['id'];
|
||||
$match_id = Event::where('betsapi_id', $event_id)->value('id');
|
||||
if ($match_id) {
|
||||
Mapper::where('event_id', $event_id)->delete();
|
||||
} else {
|
||||
Mapper::updateOrCreate(['event_id' => $event_id], $event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,15 @@ class Odds
|
||||
Notice::note('txodd odd sport: '.Nuh::$options['sport_id'], 'b');
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*/
|
||||
$info = Event::where('starttime', '<', Carbon::now()->toDateTimeString())->delete();
|
||||
|
||||
if ($debug) {
|
||||
Notice::note("Deleted: $info");
|
||||
}
|
||||
|
||||
/*************************************************
|
||||
* SINGLE SOCCER
|
||||
* https://xml2.txodds.com/feed/odds/xml.php?ident=betaid1&passwd=Dy59vpRC&peid=3118930
|
||||
|
||||
Reference in new issue
Block a user