This commit is contained in:
salam committed 2025-12-16 15:52:07 +01:00
1 parent 391bd1d1f3
commit 26bf5359bc
14 files changed
+256 -235

No files matched your search

@@ -16,7 +16,7 @@ class _3Way
$debug = NuhBash::$options['d'] ?? 0;
if ($debug) {
Notice::note('Odds 3 Way', 'b');
Notice::note('1X2 '.$odds['bookmaker_id'], 'b');
}
$update_array = [];
@@ -41,9 +41,6 @@ class _3Way
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
$update_array['source_updated_at'] = $odds['source_updated_at'];
Odds3way::updateOrCreate([
'event_id' => NuhBash::$_event->id,
'bookmaker_id' => $odds['bookmaker_id'],
], $update_array);
Odds3way::updateOrCreate($odds, $update_array);
}
}
@@ -15,7 +15,7 @@ class _Dc
$debug = NuhBash::$options['d'] ?? 0;
if ($debug) {
Notice::note('Double Chance', 'b');
Notice::note('Double Chance '.$odds['bookmaker_id'], 'b');
}
$update_array = [];
@@ -33,9 +33,6 @@ class _Dc
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
$update_array['source_updated_at'] = $odds['source_updated_at'];
OddsDc::updateOrCreate([
'event_id' => NuhBash::$_event->id,
'bookmaker_id' => $odds['bookmaker_id'],
], $update_array);
OddsDc::updateOrCreate($odds, $update_array);
}
}
@@ -0,0 +1,37 @@
<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\NuhBash;
use App\Models\OddsDnb;
use App\Utilities\Margin;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
class _Dnb
{
public static function grap($odds, $offer)
{
$debug = NuhBash::$options['d'] ?? 0;
if ($debug) {
Notice::note('Draw No Bet '.$odds['bookmaker_id'], 'b');
}
$update_array = [];
foreach ($offer as $value) {
$update_array['dnb1'] = (float) $value->o1;
$update_array['dnb2'] = (float) $value->o3;
}
$update_array['margin'] = (float) Margin::calculate($update_array, 1);
$update_array['bmoid'] = $odds['bmoid'];
$update_array['offer_id'] = $odds['offer_id'];
$update_array['flag'] = 1;
$update_array['nuh_check'] = 0;
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
$update_array['source_updated_at'] = $odds['source_updated_at'];
OddsDnb::updateOrCreate($odds, $update_array);
}
}
@@ -0,0 +1,37 @@
<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\NuhBash;
use App\Models\OddsGgng;
use App\Utilities\Margin;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
class _Ggng
{
public static function grap($odds, $offer)
{
$debug = NuhBash::$options['d'] ?? 0;
if ($debug) {
Notice::note('Goal No Goal '.$odds['bookmaker_id'], 'b');
}
$update_array = [];
foreach ($offer as $value) {
$update_array['gg'] = (float) $value->o1;
$update_array['ng'] = (float) $value->o3;
}
$update_array['margin'] = (float) Margin::calculate($update_array, 1);
$update_array['bmoid'] = $odds['bmoid'];
$update_array['offer_id'] = $odds['offer_id'];
$update_array['flag'] = 1;
$update_array['nuh_check'] = 0;
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
$update_array['source_updated_at'] = $odds['source_updated_at'];
OddsGgng::updateOrCreate($odds, $update_array);
}
}
@@ -0,0 +1,46 @@
<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\NuhBash;
use App\Models\OddsTotal;
use App\Utilities\Margin;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
class _Totals
{
public static function grap($odds, $offer)
{
$debug = NuhBash::$options['d'] ?? 0;
if ($debug) {
Notice::note('Totals '.$odds['bookmaker_id'], 'b');
}
$update_array = [];
foreach ($offer as $value) {
$update_array['over'] = (float) $value->o1;
$update_array['under'] = (float) $value->o2;
$update_array['total'] = (float) $value->o3;
}
if ($odds['sport_id'] == 1) {
if ((float) $update_array['total'] != 2.5) {
return;
}
}
$update_array['margin'] = (float) Margin::calculate([$update_array['over'], $update_array['under']], 1);
$update_array['bmoid'] = $odds['bmoid'];
$update_array['offer_id'] = $odds['offer_id'];
$update_array['flag'] = 1;
$update_array['nuh_check'] = 0;
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
$update_array['source_updated_at'] = $odds['source_updated_at'];
OddsTotal::updateOrCreate($odds, $update_array);
}
}
@@ -0,0 +1,37 @@
<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\NuhBash;
use App\Models\OddsQualify;
use App\Utilities\Margin;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
class _Tq
{
public static function grap($odds, $offer)
{
$debug = NuhBash::$options['d'] ?? 0;
if ($debug) {
Notice::note('To Qualify '.$odds['bookmaker_id'], 'b');
}
$update_array = [];
foreach ($offer as $value) {
$update_array['hta'] = (float) $value->o1;
$update_array['atq'] = (float) $value->o3;
}
$update_array['margin'] = (float) Margin::calculate($update_array, 1);
$update_array['bmoid'] = $odds['bmoid'];
$update_array['offer_id'] = $odds['offer_id'];
$update_array['flag'] = 1;
$update_array['nuh_check'] = 0;
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
$update_array['source_updated_at'] = $odds['source_updated_at'];
OddsQualify::updateOrCreate($odds, $update_array);
}
}