stuck with livewire

This commit is contained in:
salam committed 2026-01-11 09:09:16 +01:00
1 parent b21cdb507a
commit c0f2689ff6
30 files changed
+372 -64

No files matched your search

@@ -1,27 +0,0 @@
<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
class FillCollector
{
public static function set($odds, $bettype)
{
if (! isset(Nuh::$collector[$bettype][Nuh::$bookmaker_id]['difference'])) {
Nuh::$collector[$bettype][Nuh::$bookmaker_id]['difference'] = $odds['difference'];
if (isset($odds['handicap'])) {
Nuh::$collector[$bettype][Nuh::$bookmaker_id]['active_spread'] = $odds['handicap'];
} else {
Nuh::$collector[$bettype][Nuh::$bookmaker_id]['active_spread'] = $odds['total'];
}
} elseif ($odds['difference'] < Nuh::$collector[$bettype][Nuh::$bookmaker_id]['difference']) {
Nuh::$collector[$bettype][Nuh::$bookmaker_id]['difference'] = $odds['difference'];
if (isset($odds['handicap'])) {
Nuh::$collector[$bettype][Nuh::$bookmaker_id]['active_spread'] = $odds['handicap'];
} else {
Nuh::$collector[$bettype][Nuh::$bookmaker_id]['active_spread'] = $odds['total'];
}
}
}
}
@@ -1,34 +0,0 @@
<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use Illuminate\Support\Facades\DB;
class WorkCollector
{
public static function run()
{
foreach (Nuh::$collector as $table => $value) {
DB::table($table)->where('event_id', Nuh::$id)->where('provider_id', Nuh::$options['provider_id'])->update(['active_spread' => 0]);
}
foreach (Nuh::$collector as $table => $bookmaker) {
foreach ($bookmaker as $bookmaker_id => $values) {
if (in_array($table, ['odds_points', 'odds_points_ht', 'odds_points_q1'])) {
DB::table($table)
->where('event_id', Nuh::$id)
->where('bookmaker_id', $bookmaker_id)
->where('handicap', $values['active_spread'])
->update(['active_spread' => 1]);
} else {
DB::table($table)
->where('event_id', Nuh::$id)
->where('bookmaker_id', $bookmaker_id)
->where('total', $values['active_spread'])
->update(['active_spread' => 1]);
}
}
}
}
}
@@ -13,7 +13,6 @@ class _2WayS1
foreach ($offer as $value) {
$odds['h2w'] = (float) $value->o1;
$odds['a2w'] = (float) $value->o3;
$odds['starttime'] = (string) $value['starttime'];
}
$odds['margin'] = (float) Margin::calculate([$odds['h2w'], $odds['a2w']], 1);
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\Helper\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -23,7 +24,7 @@ class _Points
$odds['margin'] = (float) Margin::calculate([$odds['home'], $odds['away']], 1);
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
FillCollector::set($odds, 'odds_points');
ActiveSpread::collect($odds, 'odds_points');
DB::table('odds_points')->updateOrInsert([
'event_id' => Nuh::$id,
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\Helper\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -23,7 +24,7 @@ class _PointsHt
$odds['margin'] = (float) Margin::calculate([$odds['home'], $odds['away']], 1);
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
FillCollector::set($odds, 'odds_points_ht');
ActiveSpread::collect($odds, 'odds_points_ht');
DB::table('odds_points_ht')->updateOrInsert([
'event_id' => Nuh::$id,
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\Helper\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -23,7 +24,7 @@ class _PointsQ1
$odds['margin'] = (float) Margin::calculate([$odds['home'], $odds['away']], 1);
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
FillCollector::set($odds, 'odds_points_q1');
ActiveSpread::collect($odds, 'odds_points_q1');
DB::table('odds_points_q1')->updateOrInsert([
'event_id' => Nuh::$id,
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\Helper\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -29,7 +30,7 @@ class _Totals
$odds['margin'] = (float) Margin::calculate([$odds['over'], $odds['under']], 1);
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
FillCollector::set($odds, 'odds_totals');
ActiveSpread::collect($odds, 'odds_totals');
DB::table('odds_totals')->updateOrInsert([
'event_id' => Nuh::$id,
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\Helper\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -23,7 +24,7 @@ class _TotalsHt
$odds['margin'] = (float) Margin::calculate([$odds['over'], $odds['under']], 1);
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
FillCollector::set($odds, 'odds_totals_ht');
ActiveSpread::collect($odds, 'odds_totals_ht');
DB::table('odds_totals_ht')->updateOrInsert([
'event_id' => Nuh::$id,
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\Helper\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -23,7 +24,7 @@ class _TotalsQ1
$odds['margin'] = (float) Margin::calculate([$odds['over'], $odds['under']], 1);
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
FillCollector::set($odds, 'odds_totals_q1');
ActiveSpread::collect($odds, 'odds_totals_q1');
DB::table('odds_totals_q1')->updateOrInsert([
'event_id' => Nuh::$id,