wip
This commit is contained in:
1 parent
65dc70e681
commit
237a58fe02
12 files changed
+31
-2
No files matched your search
@@ -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'];
|
||||||
|
|
||||||
|
DB::transaction(function () use ($base, $event) {
|
||||||
Odds3way::updateOrCreate([
|
Odds3way::updateOrCreate([
|
||||||
'event_id' => $event['id'],
|
'event_id' => $event['id'],
|
||||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||||
], $base + $odds);
|
], $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);
|
||||||
|
|
||||||
|
DB::transaction(function () use ($base, $event) {
|
||||||
OddsDc::updateOrCreate([
|
OddsDc::updateOrCreate([
|
||||||
'event_id' => $event['id'],
|
'event_id' => $event['id'],
|
||||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||||
], $base + $odds);
|
], $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;
|
||||||
|
|
||||||
|
DB::transaction(function () use ($base, $event) {
|
||||||
OddsTotal::updateOrCreate([
|
OddsTotal::updateOrCreate([
|
||||||
'event_id' => $event['id'],
|
'event_id' => $event['id'],
|
||||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||||
], $base + $odds);
|
], $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);
|
||||||
|
|
||||||
|
DB::transaction(function () use ($base, $event) {
|
||||||
OddsGgng::updateOrCreate([
|
OddsGgng::updateOrCreate([
|
||||||
'event_id' => $event['id'],
|
'event_id' => $event['id'],
|
||||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||||
], $base + $odds);
|
], $base + $odds);
|
||||||
break;
|
}, 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;
|
||||||
|
|||||||
@@ -72,11 +72,13 @@ class Logifuture
|
|||||||
|
|
||||||
$event_id_collector[] = $event['id'];
|
$event_id_collector[] = $event['id'];
|
||||||
|
|
||||||
|
DB::transaction(function () use ($event, $sport_id) {
|
||||||
EventBookmaker::updateOrCreate([
|
EventBookmaker::updateOrCreate([
|
||||||
'event_id' => $event['id'],
|
'event_id' => $event['id'],
|
||||||
'sport_id' => $sport_id,
|
'sport_id' => $sport_id,
|
||||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||||
], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]);
|
], ['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::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]);
|
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);
|
||||||
|
|
||||||
|
DB::transaction(function () use ($event, $sport_id) {
|
||||||
EventBookmaker::updateOrCreate([
|
EventBookmaker::updateOrCreate([
|
||||||
'event_id' => $event['id'],
|
'event_id' => $event['id'],
|
||||||
'sport_id' => $sport_id,
|
'sport_id' => $sport_id,
|
||||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||||
], ['in_feed' => 1, 'bmoid' => $event['event_id'], 'starttime' => $event['starttime']]);
|
], ['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'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
DB::transaction(function () use ($event, $row) {
|
||||||
Event::updateOrCreate(['id' => (int) $row['id']], $event);
|
Event::updateOrCreate(['id' => (int) $row['id']], $event);
|
||||||
|
}, 5);
|
||||||
|
|
||||||
$group = [
|
$group = [
|
||||||
'competition_group_id' => (string) $row->group['cgid'],
|
'competition_group_id' => (string) $row->group['cgid'],
|
||||||
|
|||||||
Reference in new issue
Block a user