wip
This commit is contained in:
1 parent
a26c555b05
commit
cec5a5e2f7
20 files changed
+211
-120
No files matched your search
@@ -4,8 +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\Mapper\FindEvent;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
@@ -59,6 +58,7 @@ class Fixtures
|
||||
if (isset($row['home']['id']) && isset($row['away']['id']) && strpos($row['league']['name'], 'Esoccer') === false) {
|
||||
|
||||
$event = [
|
||||
'event_id' => (int) $row['id'],
|
||||
'sport_id' => (int) $sport_id,
|
||||
'provider_id' => (int) Nuh::$options['provider_id'],
|
||||
'starttime' => Carbon::createFromTimestamp((string) $row['time'])->toDateTimeString(),
|
||||
@@ -72,13 +72,8 @@ class Fixtures
|
||||
'group_id' => (int) $row['league']['id'] ?? 0,
|
||||
'group_cc' => strtoupper($row['league']['cc']) ?? '',
|
||||
];
|
||||
$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);
|
||||
}
|
||||
|
||||
FindEvent::search($event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user