logifuture

This commit is contained in:
salam committed 2026-01-07 19:45:33 +01:00
1 parent 91ec9d11cc
commit 0e34020a01
22 files changed
+546 -442

No files matched your search

@@ -1,40 +0,0 @@
<?php
namespace App\Console\Commands\Grapper\Logifuture;
use App\Console\Commands\Nuh;
use DateTime;
use DateTimeZone;
class ActiveEvent
{
public static function filter($sportid, $match)
{
$event = [];
$event['status'] = 1;
$event['bmoid'] = (int) $match['id'];
$event['bkmid'] = Nuh::$options['bookmaker_id'];
$event['sportid'] = $sportid;
$event['brmatchid'] = (int) preg_replace('"\D"', '', $match['externalId']);
$date = new DateTime($match['startDate'], new DateTimeZone('UTC'));
$date->setTimezone(new DateTimeZone('Europe/Vienna'));
$event['starttime'] = $date->getTimestamp();
$event['groupname'] = addslashes($match['tournamentName']);
$event['groupid'] = (int) $match['tournamentId'];
$event['country'] = addslashes($match['sportCategory']);
$str = str_replace('||', '|', $match['description']);
$str = trim(str_replace('|', ' ', $str));
$event['event'] = addslashes($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;
}
}
@@ -0,0 +1,36 @@
<?php
namespace App\Console\Commands\Grapper\Logifuture;
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;
}
}
@@ -2,58 +2,135 @@
namespace App\Console\Commands\Grapper\Logifuture;
use App\Console\Commands\Nuh;
use App\Models\Odds3way;
use App\Models\OddsDc;
use App\Models\OddsGgng;
use App\Models\OddsTotal;
use App\Models\OddsTq;
use App\Utilities\Margin;
class Soccer
{
public static function get(&$event, $match)
{
$_3way = [];
$_total = [];
$_ggng = [];
$_dc = [];
$_tq = [];
foreach ($match['odds'] as $name => $value) {
switch ($name) {
case 'S_1X2_1':
$event['h3w'] = (float) $value;
$_3way['h3w'] = (float) $value;
break;
case 'S_1X2_X':
$event['d3w'] = (float) $value;
$_3way['d3w'] = (float) $value;
break;
case 'S_1X2_2':
$event['a3w'] = (float) $value;
$_3way['a3w'] = (float) $value;
break;
case 'S_OU@2.5_O':
$event['total'] = 2.5;
$event['over'] = (float) $value;
$_total['over'] = (float) $value;
break;
case 'S_OU@2.5_U':
$event['total'] = 2.5;
$event['under'] = (float) $value;
$_total['under'] = (float) $value;
break;
case 'S_GGNG_Y':
$event['gg'] = (float) $value;
$_ggng['gg'] = (float) $value;
break;
case 'S_GGNG_N':
$event['ng'] = (float) $value;
$_ggng['ng'] = (float) $value;
break;
// case 'S_DNB_1':
// break;
// case 'S_DNB_2':
// break;
// case 'S_DC_12':
// $event['dc12'] = (float) $value;
// break;
// case 'S_DC_1X':
// $event['dc1x'] = (float) $value;
// break;
// case 'S_DC_X2':
// $event['dcx2'] = (float) $value;
// break;
case 'S_DC_12':
$_dc['dc12'] = (float) $value;
break;
case 'S_DC_1X':
$_dc['dc1x'] = (float) $value;
break;
case 'S_DC_X2':
$_dc['dcx2'] = (float) $value;
break;
case 'S_12QUALIFY_1':
$event['one'] = (float) $value;
$_tq['htq'] = (float) $value;
break;
case 'S_12QUALIFY_2':
$event['two'] = (float) $value;
$_tq['atq'] = (float) $value;
break;
}
}
$base = [];
$base['sport_id'] = $event['sport_id'];
$base['provider_id'] = Nuh::$options['provider_id'];
$base['bmoid'] = $event['event_id'];
$base['flag'] = 1;
// 1x2
if (\count($_3way) == 3) {
$_3way['margin'] = (float) Margin::calculate($_3way, 1);
$_3way['starttime'] = $event['starttime'];
Odds3way::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => $event['bookmaker_id'],
], $base + $_3way);
}
// OU
if (\count($_total) == 2) {
$_total['margin'] = (float) Margin::calculate($_total, 1);
$_total['total'] = 2.5;
$_total['starttime'] = $event['starttime'];
OddsTotal::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => $event['bookmaker_id'],
], $base + $_total);
}
// GG NG
if (\count($_ggng) == 2) {
$_ggng['margin'] = (float) Margin::calculate($_ggng, 1);
$_ggng['starttime'] = $event['starttime'];
OddsGgng::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => $event['bookmaker_id'],
], $base + $_ggng);
}
// DC
if (\count($_dc) == 3) {
$_dc['margin'] = (float) Margin::calculate($_dc, 1);
$_dc['starttime'] = $event['starttime'];
OddsDc::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => $event['bookmaker_id'],
], $base + $_dc);
}
// TQ
if (\count($_tq) == 2) {
$_tq['margin'] = (float) Margin::calculate($_tq, 1);
$_tq['starttime'] = $event['starttime'];
OddsTq::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => $event['bookmaker_id'],
], $base + $_tq);
}
}
}