wip
This commit is contained in:
1 parent
65dc70e681
commit
237a58fe02
12 files changed
+59
-30
No files matched your search
@@ -11,6 +11,7 @@ use App\Models\OddsGgng;
|
||||
use App\Models\OddsTotal;
|
||||
use App\Utilities\Margin;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Betica
|
||||
{
|
||||
@@ -141,10 +142,13 @@ class Betica
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
$odds['starttime'] = (string) $row['start_time'];
|
||||
|
||||
Odds3way::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
DB::transaction(function () use ($base, $event) {
|
||||
Odds3way::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
}, 5);
|
||||
|
||||
break;
|
||||
|
||||
case 10:
|
||||
@@ -161,10 +165,13 @@ class Betica
|
||||
}
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
|
||||
OddsDc::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
DB::transaction(function () use ($base, $event) {
|
||||
OddsDc::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
}, 5);
|
||||
|
||||
break;
|
||||
|
||||
case 18:
|
||||
@@ -180,10 +187,13 @@ class Betica
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
$odds['total'] = 2.5;
|
||||
|
||||
OddsTotal::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
DB::transaction(function () use ($base, $event) {
|
||||
OddsTotal::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
}, 5);
|
||||
|
||||
break;
|
||||
|
||||
case 29:
|
||||
@@ -198,11 +208,12 @@ class Betica
|
||||
}
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
|
||||
OddsGgng::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
break;
|
||||
DB::transaction(function () use ($base, $event) {
|
||||
OddsGgng::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
}, 5);
|
||||
|
||||
default:
|
||||
dd($bettypes);
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Models\Supervisor;
|
||||
use App\Utilities\Margin;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Odds
|
||||
{
|
||||
@@ -106,7 +107,7 @@ class Odds
|
||||
break;
|
||||
case '1_3':
|
||||
|
||||
dd($value);
|
||||
// dd($value);
|
||||
|
||||
$odds = [];
|
||||
$odds['h3w'] = number_format($value[0]['home_od'], 2) ?? 1;
|
||||
|
||||
@@ -72,11 +72,13 @@ class Logifuture
|
||||
|
||||
$event_id_collector[] = $event['id'];
|
||||
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]);
|
||||
DB::transaction(function () use ($event, $sport_id) {
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]);
|
||||
}, 5);
|
||||
|
||||
switch ($sport_id) {
|
||||
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'];
|
||||
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\Odds3way;
|
||||
use App\Utilities\Margin;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Icehockey
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\OddsGgng;
|
||||
use App\Models\OddsTotal;
|
||||
use App\Models\OddsTq;
|
||||
use App\Utilities\Margin;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Soccer
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Models\Odds2way;
|
||||
use App\Models\Odds2wayS1;
|
||||
use App\Utilities\Margin;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Tennis
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Logifuture\Tools;
|
||||
|
||||
use App\Models\OddsPoint;
|
||||
use App\Utilities\Margin;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class LogifutureStorePoints
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Logifuture\Tools;
|
||||
|
||||
use App\Models\OddsPointQ1;
|
||||
use App\Utilities\Margin;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class LogifutureStorePointsQ1
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Logifuture\Tools;
|
||||
|
||||
use App\Models\OddsTotal;
|
||||
use App\Utilities\Margin;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class LogifutureStoreTotals
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Logifuture\Tools;
|
||||
|
||||
use App\Models\OddsTotalQ1;
|
||||
use App\Utilities\Margin;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class LogifutureStoreTotalsQ1
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\EventBookmaker;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Fixtures
|
||||
{
|
||||
@@ -100,11 +101,13 @@ class Fixtures
|
||||
|
||||
FindFixture::find($event);
|
||||
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], ['in_feed' => 1, 'bmoid' => $event['event_id'], 'starttime' => $event['starttime']]);
|
||||
DB::transaction(function () use ($event, $sport_id) {
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'sport_id' => $sport_id,
|
||||
'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\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Fixtures
|
||||
{
|
||||
@@ -74,7 +75,9 @@ class Fixtures
|
||||
'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 = [
|
||||
'competition_group_id' => (string) $row->group['cgid'],
|
||||
|
||||
Reference in new issue
Block a user