grapper wip

This commit is contained in:
salam committed 2026-01-18 14:35:30 +01:00
1 parent 562c65f331
commit 4184acdb8a
60 files changed
+28840 -398

No files matched your search

@@ -3,6 +3,8 @@
namespace App\Console\Commands\Grapper\Logifuture;
use App\Console\Commands\Grapper\Logifuture\Tools\PrinzipalHandicap;
use App\Models\OddsTotal;
use App\Utilities\Margin;
class Basketball
{
@@ -45,35 +47,37 @@ class Basketball
switch ($market) {
// NIGERIA
case 'B_OUN':
$n_totals[$name] = $value;
$n_totals[$name] = number_format($value, 2);
break;
case 'B_1QOU':
$n_totals_qt[$name] = $value;
$n_totals_qt[$name] = number_format($value, 2);
break;
case 'B_H':
$n_points[$name] = $value;
$n_points[$name] = number_format($value, 2);
break;
case 'B_1QH':
$n_points_qt[$name] = $value;
$n_points_qt[$name] = number_format($value, 2);
break;
// COLOMBIA
case 'B_OUHND':
$c_totals[$name] = $value;
$c_totals[$name] = number_format($value, 2);
break;
case 'B_OUHND1P':
$c_totals_qt[$name] = $value;
$c_totals_qt[$name] = number_format($value, 2);
break;
case 'B_12HND':
$c_points[$name] = $value;
$c_points[$name] = number_format($value, 2);
break;
case 'B_12HND1P':
$c_points_qt[$name] = $value;
$c_points_qt[$name] = number_format($value, 2);
break;
}
}
}
dd($n_totals);
// COLUMBIA
if ($c_totals) {
PrinzipalHandicap::filter($_spreads['total'], 'B_OUHND@', $c_totals, ['over', 'under', 'total']);
@@ -101,5 +105,32 @@ class Basketball
if ($n_points_qt) {
PrinzipalHandicap::filter($_spreads['point_qt'], 'B_1QH@', $n_points_qt, ['hth1', 'hth2', 'hcap']);
}
dd($n_totals);
if (\count($n_totals) == 2) {
$_total['margin'] = (float) Margin::calculate($n_totals, 1);
$_total = array_merge($_total, $base);
$res = OddsTotal::where('event_id', $event['id'])
->where('bookmaker_id', $event['bookmaker_id'])
->where('total', $event['total'])
->first();
if (! $res) {
OddsTotal::create($_total);
} else {
$res->over = number_format($_total['over'], 2);
$res->under = number_format($_total['under'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->margin = $_total['margin'];
$res->save();
}
}
}
}