This commit is contained in:
salam committed 2026-02-16 10:15:07 +01:00
1 parent 65dc70e681
commit 237a58fe02
12 files changed
+59 -30

No files matched your search

+28 -17
View File
@@ -11,6 +11,7 @@ use App\Models\OddsGgng;
use App\Models\OddsTotal; use App\Models\OddsTotal;
use App\Utilities\Margin; use App\Utilities\Margin;
use App\Utilities\Notice; use App\Utilities\Notice;
use Illuminate\Support\Facades\DB;
class Betica class Betica
{ {
@@ -141,10 +142,13 @@ class Betica
$odds['margin'] = (float) Margin::calculate($odds, 1); $odds['margin'] = (float) Margin::calculate($odds, 1);
$odds['starttime'] = (string) $row['start_time']; $odds['starttime'] = (string) $row['start_time'];
Odds3way::updateOrCreate([ DB::transaction(function () use ($base, $event) {
'event_id' => $event['id'], Odds3way::updateOrCreate([
'bookmaker_id' => Nuh::$options['bookmaker_id'], 'event_id' => $event['id'],
], $base + $odds); 'bookmaker_id' => Nuh::$options['bookmaker_id'],
], $base + $odds);
}, 5);
break; break;
case 10: case 10:
@@ -161,10 +165,13 @@ class Betica
} }
$odds['margin'] = (float) Margin::calculate($odds, 1); $odds['margin'] = (float) Margin::calculate($odds, 1);
OddsDc::updateOrCreate([ DB::transaction(function () use ($base, $event) {
'event_id' => $event['id'], OddsDc::updateOrCreate([
'bookmaker_id' => Nuh::$options['bookmaker_id'], 'event_id' => $event['id'],
], $base + $odds); 'bookmaker_id' => Nuh::$options['bookmaker_id'],
], $base + $odds);
}, 5);
break; break;
case 18: case 18:
@@ -180,10 +187,13 @@ class Betica
$odds['margin'] = (float) Margin::calculate($odds, 1); $odds['margin'] = (float) Margin::calculate($odds, 1);
$odds['total'] = 2.5; $odds['total'] = 2.5;
OddsTotal::updateOrCreate([ DB::transaction(function () use ($base, $event) {
'event_id' => $event['id'], OddsTotal::updateOrCreate([
'bookmaker_id' => Nuh::$options['bookmaker_id'], 'event_id' => $event['id'],
], $base + $odds); 'bookmaker_id' => Nuh::$options['bookmaker_id'],
], $base + $odds);
}, 5);
break; break;
case 29: case 29:
@@ -198,11 +208,12 @@ class Betica
} }
$odds['margin'] = (float) Margin::calculate($odds, 1); $odds['margin'] = (float) Margin::calculate($odds, 1);
OddsGgng::updateOrCreate([ DB::transaction(function () use ($base, $event) {
'event_id' => $event['id'], OddsGgng::updateOrCreate([
'bookmaker_id' => Nuh::$options['bookmaker_id'], 'event_id' => $event['id'],
], $base + $odds); 'bookmaker_id' => Nuh::$options['bookmaker_id'],
break; ], $base + $odds);
}, 5);
default: default:
dd($bettypes); dd($bettypes);
@@ -10,6 +10,7 @@ use App\Models\Supervisor;
use App\Utilities\Margin; use App\Utilities\Margin;
use App\Utilities\Notice; use App\Utilities\Notice;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
class Odds class Odds
{ {
@@ -106,7 +107,7 @@ class Odds
break; break;
case '1_3': case '1_3':
dd($value); // dd($value);
$odds = []; $odds = [];
$odds['h3w'] = number_format($value[0]['home_od'], 2) ?? 1; $odds['h3w'] = number_format($value[0]['home_od'], 2) ?? 1;
+10 -6
View File
@@ -72,11 +72,13 @@ class Logifuture
$event_id_collector[] = $event['id']; $event_id_collector[] = $event['id'];
EventBookmaker::updateOrCreate([ DB::transaction(function () use ($event, $sport_id) {
'event_id' => $event['id'], EventBookmaker::updateOrCreate([
'sport_id' => $sport_id, 'event_id' => $event['id'],
'bookmaker_id' => Nuh::$options['bookmaker_id'], 'sport_id' => $sport_id,
], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]); 'bookmaker_id' => Nuh::$options['bookmaker_id'],
], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]);
}, 5);
switch ($sport_id) { switch ($sport_id) {
case 1: case 1:
@@ -106,7 +108,9 @@ class Logifuture
$tables = ['odds_2ways', 'odds_2ways_s1', 'odds_3ways', 'odds_totals', 'odds_points', 'odds_ggng', 'odds_dc', 'odds_tq', 'odds_points_q1', 'odds_totals_q1']; $tables = ['odds_2ways', 'odds_2ways_s1', 'odds_3ways', 'odds_totals', 'odds_points', 'odds_ggng', 'odds_dc', 'odds_tq', 'odds_points_q1', 'odds_totals_q1'];
foreach ($tables as $table) { foreach ($tables as $table) {
DB::table($table)->where('bookmaker_id', Nuh::$options['bookmaker_id'])->whereNotIn('event_id', $event_id_collector)->update(['flags' => 0]); DB::transaction(function () use ($table, $event_id_collector) {
DB::table($table)->where('bookmaker_id', Nuh::$options['bookmaker_id'])->whereNotIn('event_id', $event_id_collector)->update(['flags' => 0]);
}, 5);
} }
} }
} }
@@ -12,6 +12,7 @@ use App\Models\Odds2way;
use App\Models\Odds2wayS1; use App\Models\Odds2wayS1;
use App\Models\Odds3way; use App\Models\Odds3way;
use App\Utilities\Margin; use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class Icehockey class Icehockey
{ {
@@ -9,6 +9,7 @@ use App\Models\OddsGgng;
use App\Models\OddsTotal; use App\Models\OddsTotal;
use App\Models\OddsTq; use App\Models\OddsTq;
use App\Utilities\Margin; use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class Soccer class Soccer
{ {
@@ -10,6 +10,7 @@ use App\Models\Odds2way;
use App\Models\Odds2wayS1; use App\Models\Odds2wayS1;
use App\Utilities\Margin; use App\Utilities\Margin;
use App\Utilities\Notice; use App\Utilities\Notice;
use Illuminate\Support\Facades\DB;
class Tennis class Tennis
{ {
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Logifuture\Tools;
use App\Models\OddsPoint; use App\Models\OddsPoint;
use App\Utilities\Margin; use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class LogifutureStorePoints class LogifutureStorePoints
{ {
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Logifuture\Tools;
use App\Models\OddsPointQ1; use App\Models\OddsPointQ1;
use App\Utilities\Margin; use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class LogifutureStorePointsQ1 class LogifutureStorePointsQ1
{ {
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Logifuture\Tools;
use App\Models\OddsTotal; use App\Models\OddsTotal;
use App\Utilities\Margin; use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class LogifutureStoreTotals class LogifutureStoreTotals
{ {
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Logifuture\Tools;
use App\Models\OddsTotalQ1; use App\Models\OddsTotalQ1;
use App\Utilities\Margin; use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class LogifutureStoreTotalsQ1 class LogifutureStoreTotalsQ1
{ {
@@ -9,6 +9,7 @@ use App\Models\EventBookmaker;
use App\Models\Sport; use App\Models\Sport;
use App\Utilities\Notice; use App\Utilities\Notice;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
class Fixtures class Fixtures
{ {
@@ -100,11 +101,13 @@ class Fixtures
FindFixture::find($event); FindFixture::find($event);
EventBookmaker::updateOrCreate([ DB::transaction(function () use ($event, $sport_id) {
'event_id' => $event['id'], EventBookmaker::updateOrCreate([
'sport_id' => $sport_id, 'event_id' => $event['id'],
'bookmaker_id' => Nuh::$options['bookmaker_id'], 'sport_id' => $sport_id,
], ['in_feed' => 1, 'bmoid' => $event['event_id'], 'starttime' => $event['starttime']]); 'bookmaker_id' => Nuh::$options['bookmaker_id'],
], ['in_feed' => 1, 'bmoid' => $event['event_id'], 'starttime' => $event['starttime']]);
}, 5);
} }
} }
@@ -12,6 +12,7 @@ use App\Models\Group;
use App\Models\Sport; use App\Models\Sport;
use App\Utilities\Notice; use App\Utilities\Notice;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
class Fixtures class Fixtures
{ {
@@ -74,7 +75,9 @@ class Fixtures
'competition_group_id' => (int) $row->group['cgid'], 'competition_group_id' => (int) $row->group['cgid'],
]; ];
Event::updateOrCreate(['id' => (int) $row['id']], $event); DB::transaction(function () use ($event, $row) {
Event::updateOrCreate(['id' => (int) $row['id']], $event);
}, 5);
$group = [ $group = [
'competition_group_id' => (string) $row->group['cgid'], 'competition_group_id' => (string) $row->group['cgid'],