grapper logifuture wip

This commit is contained in:
salam committed 2026-01-07 13:24:56 +01:00
1 parent 0bee21dc2d
commit 91ec9d11cc
10 files changed
+480 -324

No files matched your search

+72 -10
View File
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Grapper;
use App\Console\Commands\Grapper\Logifuture\ActiveEvent;
use App\Console\Commands\Grapper\Logifuture\Auth;
use App\Console\Commands\Grapper\Logifuture\BaseUrl;
use App\Console\Commands\Nuh;
@@ -52,19 +53,80 @@ class Logifuture
]);
$file = curl_exec($ch);
$matches = json_decode($file, 1);
dd($file);
if (! isset($matches['error'])) {
$data = json_decode($file, true);
foreach ($matches as $match) {
dd($data);
if (strpos($match['sportCategory'], 'Simulated Reality') === false) {
$event = ActiveEvent::filter($sportid, $match);
dd($event);
$_spreads = [];
switch ($sportid) {
case 1:
Soccer::get($event, $match);
break;
case 2:
Icehockey::get($event, $_spreads, $match);
break;
case 3:
Basket::get($event, $_spreads, $match);
break;
case 5:
Tennis::get($event, $_spreads, $match);
break;
default:
Notice::note('SPORT NOT IMPLEMENTED', 'r', 1);
break;
}
Parser::$_matches_array = [];
Parser::$_matches_array[] = $event;
$matchid = Parser::processData(1);
if ($matchid) {
$event['matchid'] = $matchid;
if (isset($_spreads['point'])) {
$tmp = $event + $_spreads['point'];
DB_Parser::addPointOdds('bai_points', $matchid, $tmp);
}
if (isset($_spreads['point_qt'])) {
$tmp = $event + $_spreads['point_qt'];
DB_Parser::addPointOdds('bai_points_qt', $matchid, $tmp);
}
if (isset($_spreads['total'])) {
$tmp = $event + $_spreads['total'];
DB_Parser::addTotalOdds('bai_totals', $matchid, $tmp);
}
if (isset($_spreads['total_qt'])) {
$tmp = $event + $_spreads['total_qt'];
DB_Parser::addTotalOdds('bai_totals_qt', $matchid, $tmp);
}
if (isset($_spreads['mlset1'])) {
$tmp = $event + $_spreads['mlset1'];
DB_Parser::addTotalOdds('bai_2way_set1', $matchid, $tmp);
}
if (Database::$debug) {
Notice::note($event, 'y');
}
}
}
}
Parser::flagStatus($sportid);
}
}
}
}
$header = [];
$header[] = 'Authorization: Bearer '.$data['token'];
$header[] = 'accept: application/json';
$header[] = 'content-type: application/json';
return $header;