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',
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user