37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Grapper\Logifuture\Tools;
|
|
|
|
use App\Console\Commands\Nuh;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
class MapEvent
|
|
{
|
|
public static function filter($sport_id, $match)
|
|
{
|
|
|
|
$event = [];
|
|
$event['event_id'] = (int) $match['id'];
|
|
$event['bookmaker_id'] = Nuh::$options['bookmaker_id'];
|
|
$event['betradar_id'] = (int) preg_replace('"\D"', '', $match['externalId']);
|
|
$event['sport_id'] = $sport_id;
|
|
$event['provider_id'] = Nuh::$options['provider_id'];
|
|
$event['starttime'] = Carbon::parse($match['startDate'])->toDateTimeString();
|
|
$event['country'] = $match['sportCategory'];
|
|
$event['group_id'] = (int) $match['tournamentId'];
|
|
$event['group'] = addslashes($match['tournamentName']);
|
|
|
|
$str = str_replace('||', '|', $match['description']);
|
|
$str = trim(str_replace('|', ' ', $str));
|
|
if (Nuh::$options['bookmaker_id'] == 36) {
|
|
$teams = explode(' v ', $str);
|
|
} else {
|
|
$teams = explode(' - ', $str);
|
|
}
|
|
$event['home'] = addslashes($teams[0]);
|
|
$event['away'] = addslashes($teams[1]);
|
|
|
|
return $event;
|
|
}
|
|
}
|