wip
This commit is contained in:
1 parent
7dce81013b
commit
668310b03d
12 files changed
+87
-124
No files matched your search
@@ -8,13 +8,14 @@ use App\Console\Commands\Grapper\Magloo\Odds\FilterTotals;
|
||||
use App\Console\Commands\Grapper\Magloo\Odds\FilterTotalsQ1;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\Odds3way;
|
||||
use App\Models\OddsDc;
|
||||
use App\Models\OddsHandicap;
|
||||
use App\Models\OddsHandicapQ1;
|
||||
use App\Models\OddsQualify;
|
||||
use App\Models\OddsTotal;
|
||||
use App\Models\OddsTotalQ1;
|
||||
use App\Models\OddsTq;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Margin;
|
||||
use App\Utilities\Notice;
|
||||
@@ -27,6 +28,8 @@ class Odds
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$proxy = Nuh::$options['p'] ?? 0;
|
||||
|
||||
$event_id_collector = [];
|
||||
|
||||
$sportmap = Sport::map('magl', 1, [1, 3]);
|
||||
|
||||
if ($proxy) {
|
||||
@@ -76,7 +79,12 @@ class Odds
|
||||
$base['bmoid'] = preg_replace('/\D/', '', $match['i']);
|
||||
$base['flag'] = 1;
|
||||
|
||||
// dd($match['M']);
|
||||
$event_id_collector[] = $event_id;
|
||||
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $base['bmoid']]);
|
||||
|
||||
foreach ($match['M'] as $magloo_bettype_id => $value) {
|
||||
switch ($magloo_bettype_id) {
|
||||
@@ -102,7 +110,7 @@ class Odds
|
||||
$odds['atq'] = $value['static'][5] ?? 1;
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
|
||||
OddsQualify::updateOrCreate([
|
||||
OddsTq::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
@@ -189,5 +197,9 @@ class Odds
|
||||
}
|
||||
}
|
||||
|
||||
EventBookmaker::whereNotIn('event_id', $event_id_collector)
|
||||
->where('bookmaker_id', $bookmaker_id)
|
||||
->update(['in_feed' => 0]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ class Odds
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('call counter: '.$counter, 'g');
|
||||
Notice::note('counter: '.count($_calls).'/'.$counter, 'g');
|
||||
}
|
||||
|
||||
foreach ($data as $row) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\OddsQualify;
|
||||
use App\Models\OddsTq;
|
||||
use App\Utilities\Margin;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
@@ -23,7 +23,7 @@ class _Tq
|
||||
}
|
||||
$odds['margin'] = (float) Margin::calculate([$odds['htq'], $odds['atq']], 1);
|
||||
|
||||
OddsQualify::updateOrCreate([
|
||||
OddsTq::updateOrCreate([
|
||||
'event_id' => Nuh::$id,
|
||||
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||
], $odds);
|
||||
|
||||
@@ -8,6 +8,8 @@ use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\SelectColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Columns\ToggleColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class SupervisorsTable
|
||||
@@ -42,8 +44,11 @@ class SupervisorsTable
|
||||
ToggleColumn::make('is_active')->label('On/Off'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
SelectFilter::make('provider_id')
|
||||
->relationship('provider', 'name')
|
||||
->label('Provider'),
|
||||
], layout: FiltersLayout::AboveContent)
|
||||
->deferFilters(false)
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
|
||||
@@ -8,18 +8,14 @@ class Column3way extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column_3way';
|
||||
|
||||
protected ?array $max;
|
||||
|
||||
protected ?array $min;
|
||||
|
||||
protected ?array $act;
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
@@ -32,40 +28,23 @@ class Column3way extends Column
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->max['h3w'] = $record->odds_3way->max('h3w');
|
||||
$this->min['h3w'] = $record->odds_3way->min('h3w');
|
||||
$this->act['h3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id);
|
||||
|
||||
$this->max['d3w'] = $record->odds_3way->max('d3w');
|
||||
$this->min['d3w'] = $record->odds_3way->min('d3w');
|
||||
$this->act['d3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('d3w');
|
||||
|
||||
$this->max['a3w'] = $record->odds_3way->max('a3w');
|
||||
$this->min['a3w'] = $record->odds_3way->min('a3w');
|
||||
$this->act['a3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('a3w');
|
||||
|
||||
$this->max['margin'] = $record->odds_3way->max('margin');
|
||||
$this->min['margin'] = $record->odds_3way->min('margin');
|
||||
$this->act['margin'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('margin');
|
||||
|
||||
dd($this->act);
|
||||
|
||||
$this->has_data = count($record->odds_3way) ? true : false;
|
||||
}
|
||||
|
||||
public function getAct()
|
||||
{
|
||||
return $this->act;
|
||||
}
|
||||
$tmp = [];
|
||||
$tmp['max_h3w'] = $record->odds_3way->max('h3w');
|
||||
$tmp['min_h3w'] = $record->odds_3way->min('h3w');
|
||||
$tmp['max_d3w'] = $record->odds_3way->max('d3w');
|
||||
$tmp['min_d3w'] = $record->odds_3way->min('d3w');
|
||||
$tmp['max_a3w'] = $record->odds_3way->max('a3w');
|
||||
$tmp['min_a3w'] = $record->odds_3way->min('a3w');
|
||||
|
||||
public function getMax()
|
||||
{
|
||||
return $this->max;
|
||||
}
|
||||
|
||||
public function getMin()
|
||||
{
|
||||
return $this->min;
|
||||
foreach ($record->odds_3way as $key => $value) {
|
||||
if ($value->h3w == $tmp['max_h3w']) {
|
||||
$record->odds_3way->key->max_h3w = true;
|
||||
} else {
|
||||
$record->odds_3way->key->max_h3w = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
|
||||
@@ -10,6 +10,7 @@ class EventBookmaker extends Model
|
||||
'event_id',
|
||||
'bookmaker_id',
|
||||
'bmoid',
|
||||
'in_feed',
|
||||
'send_status',
|
||||
'bkm_starttime',
|
||||
];
|
||||
|
||||
@@ -16,6 +16,7 @@ return new class extends Migration
|
||||
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
|
||||
$table->integer('bookmaker_id')->index()->references('id')->on('bookmakers');
|
||||
$table->string('bmoid')->nullable();
|
||||
$table->boolean('in_feed')->default(0);
|
||||
$table->boolean('send_status')->default(0);
|
||||
$table->timestamp('bkm_starttime')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
@@ -27,7 +27,7 @@ class RolesAndPermissionsSeeder extends Seeder
|
||||
'email_verified_at' => now(),
|
||||
'client_id' => 1,
|
||||
'sport_id' => 1,
|
||||
'bookmaker_id' => 20,
|
||||
'bookmaker_id' => 10,
|
||||
'provider_id' => 4,
|
||||
]);
|
||||
$user->assignRole('super_admin');
|
||||
@@ -42,7 +42,7 @@ class RolesAndPermissionsSeeder extends Seeder
|
||||
'email_verified_at' => now(),
|
||||
'client_id' => 1,
|
||||
'sport_id' => 1,
|
||||
'bookmaker_id' => 20,
|
||||
'bookmaker_id' => 10,
|
||||
'provider_id' => 4,
|
||||
]);
|
||||
$user->assignRole('super_admin');
|
||||
|
||||
@@ -14,17 +14,18 @@ class SupervisorSeeder extends Seeder
|
||||
*/
|
||||
$sql = "INSERT INTO `supervisors` (`id`, `name`, `provider_id`, `sport_id`, `sleep`, `limit`, `runtime`, `maxsconds`, `lastcall`, `is_cron`, `is_active`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
(1, 'Fixtures', 1, 1, 10, 0, '0.59', 1800, 0, 1, 1, '2025-08-27 07:39:55', '2026-01-03 09:55:09'),
|
||||
(1, 'Fixtures', 1, 1, 10, 0, '0.073', 1800, 0, 1, 1, '2025-08-27 07:39:55', '2026-01-04 10:09:15'),
|
||||
(2, 'Odds', 1, 1, 10, 0, '0.251', 30, 0, 0, 1, '2025-12-01 05:41:02', '2025-12-22 05:20:40'),
|
||||
(3, 'Fixtures', 2, 0, 15, 0, NULL, 1800, 0, 1, 1, '2025-12-19 11:42:35', '2025-12-22 06:41:47'),
|
||||
(4, 'Willhill', 2, 0, 15, 0, '0.235', 1800, 0, 1, 1, '2025-12-19 11:48:05', '2025-12-22 06:41:51'),
|
||||
(5, 'Bwin', 2, 0, 15, 0, '0.436', 1800, 0, 1, 1, '2025-12-22 06:41:18', '2026-01-03 10:12:40'),
|
||||
(3, 'Fixtures', 2, 0, 15, 0, '0.133', 1800, 0, 1, 1, '2025-12-19 11:42:35', '2026-01-04 10:25:00'),
|
||||
(4, 'Willhill', 2, 0, 15, 0, '2.119', 1800, 0, 1, 1, '2025-12-19 11:48:05', '2026-01-04 10:27:11'),
|
||||
(5, 'Bwin', 2, 0, 15, 0, '0.084', 1800, 0, 1, 1, '2025-12-22 06:41:18', '2026-01-04 10:29:32'),
|
||||
(6, 'Bet365', 2, 0, 10, 0, '0', 30, 0, 0, 1, '2025-12-18 17:44:33', '2026-01-01 17:09:28'),
|
||||
(7, 'Betfair', 2, 0, 10, 0, '0', 30, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-03 12:28:09'),
|
||||
(8, 'Fixtures', 4, 0, 10, 0, '1.368', 30, 0, 1, 1, '2025-12-18 17:44:33', '2026-01-03 12:24:52'),
|
||||
(9, 'Odds', 4, 0, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53');
|
||||
(9, 'Odds', 4, 0, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53'),
|
||||
(10, 'Fixtures', 3, 0, 10, 0, '1.368', 30, 0, 1, 1, '2025-12-18 17:44:33', '2026-01-03 12:24:52'),
|
||||
(11, 'Odds', 3, 0, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53');
|
||||
";
|
||||
DB::unprepared($sql);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,57 +4,15 @@
|
||||
|
||||
@if ($hasData())
|
||||
|
||||
@include('filament.tables.columns.fumetto.fumetto_1x2')
|
||||
{{-- @include('filament.tables.columns.fumetto.fumetto_1x2') --}}
|
||||
|
||||
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-5" style="width: 225px;">
|
||||
|
||||
@include('filament.tables.columns.multiline.label', ['labels' => ['1', 'X', '2']])
|
||||
|
||||
@foreach ($record->odds_3way as $item)
|
||||
@if ($item->bookmaker_id == auth()->user()->bookmaker_id)
|
||||
@include('filament.tables.columns.multiline.bkm', [
|
||||
'bookmaker_id' => $item->bookmaker_id,
|
||||
'icon' => $item->bookmaker->icon ?? '',
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->h3w,
|
||||
'decimal' => 2,
|
||||
'max' => false,
|
||||
'min' => false,
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->d3w,
|
||||
'decimal' => 2,
|
||||
'max' => false,
|
||||
'min' => false,
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->a3w,
|
||||
'decimal' => 2,
|
||||
'max' => false,
|
||||
'min' => false,
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->margin,
|
||||
'decimal' => 1,
|
||||
'max' => false,
|
||||
'min' => false,
|
||||
])
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<div class="col-span-5 h-2"></div>
|
||||
|
||||
@php
|
||||
$act = $getAct();
|
||||
@endphp
|
||||
|
||||
@foreach ($getBookmaker() as $bookmaker_id)
|
||||
@foreach ($record->odds_3way as $item)
|
||||
|
||||
@if ($item->bookmaker_id == $bookmaker_id)
|
||||
@include('filament.tables.columns.multiline.bkm', [
|
||||
'bookmaker_id' => $item->bookmaker_id,
|
||||
@@ -63,29 +21,32 @@
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->h3w,
|
||||
'decimal' => 2,
|
||||
'dec' => 2,
|
||||
'hig' => $item->max_h3w,
|
||||
'max' => false,
|
||||
'min' => false,
|
||||
'over' => $item->d3w < $act['h3w'] ? 1 : 0,
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->d3w,
|
||||
'decimal' => 2,
|
||||
'dec' => 2,
|
||||
'hig' => false,
|
||||
'max' => false,
|
||||
'min' => false,
|
||||
])
|
||||
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->a3w,
|
||||
'decimal' => 2,
|
||||
'dec' => 2,
|
||||
'hig' => false,
|
||||
'max' => false,
|
||||
'min' => false,
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->margin,
|
||||
'decimal' => 1,
|
||||
'dec' => 1,
|
||||
'hig' => false,
|
||||
'max' => false,
|
||||
'min' => false,
|
||||
])
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
|
||||
@include('filament.tables.columns.multiline.label', ['labels' => ['1', 'X', '2']])
|
||||
|
||||
@php
|
||||
$max = $getMax();
|
||||
$min = $getMin();
|
||||
@endphp
|
||||
|
||||
@foreach ($record->odds_3way as $item)
|
||||
@include('filament.tables.columns.multiline.bkm', [
|
||||
'bookmaker_id' => $item->bookmaker_id,
|
||||
@@ -19,29 +14,27 @@
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->h3w,
|
||||
'decimal' => 2,
|
||||
'max' => $item->h3w == $max['h3w'] ? 1 : 0,
|
||||
'min' => $item->h3w == $min['h3w'] ? 1 : 0,
|
||||
'max' => $item?->max_h3w,
|
||||
'min' => $item?->min_h3w,
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->d3w,
|
||||
'decimal' => 2,
|
||||
'max' => $item->d3w == $max['d3w'] ? 1 : 0,
|
||||
'min' => $item->d3w == $min['d3w'] ? 1 : 0,
|
||||
'max' => $item?->max_d3w,
|
||||
'min' => $item?->min_d3w,
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->a3w,
|
||||
'decimal' => 2,
|
||||
'max' => $item->a3w == $max['a3w'] ? 1 : 0,
|
||||
'min' => $item->a3w == $min['a3w'] ? 1 : 0,
|
||||
'max' => $item?->max_a3w,
|
||||
'min' => $item?->min_a3w,
|
||||
])
|
||||
|
||||
@include('filament.tables.columns.multiline.odds', [
|
||||
'odd' => $item->margin,
|
||||
'decimal' => 1,
|
||||
'max' => $item->margin == $max['margin'] ? 1 : 0,
|
||||
'min' => $item->margin == $min['margin'] ? 1 : 0,
|
||||
])
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
<div class="mb-0.5 ml-0.5
|
||||
@if (isset($max) && $max == true) bg-green-600/25 rounded
|
||||
@elseif (isset($min) && $min == true) bg-blue-600/25 rounded @endif
|
||||
@if (isset($over) && $over == true) border border-gray-300 bg-gray-100 @endif"
|
||||
style="font-size: 10.5px; text-align:center;">
|
||||
|
||||
@if (isset($odd))
|
||||
{{ number_format($odd, $decimal) }}
|
||||
<div style="font-size: 10.5px; text-align:center;" class="mb-0.5 ml-0.5
|
||||
|
||||
@if($max)
|
||||
bg-green-600/25 rounded
|
||||
@endif
|
||||
|
||||
@if($min)
|
||||
bg-blue-600/25 rounded
|
||||
@endif
|
||||
|
||||
@if($hig)
|
||||
bg-gray-400/25 rounded
|
||||
@endif
|
||||
|
||||
">
|
||||
|
||||
@if (isset($odd))
|
||||
{{ number_format($odd, $dec) }}
|
||||
@endif
|
||||
|
||||
</div>
|
||||
Reference in new issue
Block a user