wip
This commit is contained in:
1 parent
49b1eba348
commit
9ca5657827
28 files changed
+288
-234
No files matched your search
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Fixtures;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\Mapper;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
@@ -50,19 +51,23 @@ class FindFixture
|
||||
break;
|
||||
case 3:
|
||||
// MAGLOO KENIA
|
||||
$match = Event::where('magken_id', $event_id)->first();
|
||||
$res = EventBookmaker::where('bookmaker_id', 10)->where('event_id', $event_id)->first();
|
||||
$match = Event::where('id', $res->event_id)->first();
|
||||
break;
|
||||
case 4:
|
||||
// MAGLOO NIGERIA
|
||||
$match = Event::where('magnig_id', $event_id)->first();
|
||||
$res = EventBookmaker::where('bookmaker_id', 16)->where('event_id', $event_id)->first();
|
||||
$match = Event::where('id', $res->event_id)->first();
|
||||
break;
|
||||
case 5:
|
||||
// LOGIFUTUR NIGERA
|
||||
$match = Event::where('lognig_id', $event_id)->first();
|
||||
$res = EventBookmaker::where('bookmaker_id', 35)->where('event_id', $event_id)->first();
|
||||
$match = Event::where('id', $res->event_id)->first();
|
||||
break;
|
||||
case 6:
|
||||
// LOGIFUTUR COLOMBIA
|
||||
$match = Event::where('logcol_id', $event_id)->first();
|
||||
$res = EventBookmaker::where('bookmaker_id', 36)->where('event_id', $event_id)->first();
|
||||
$match = Event::where('id', $res->event_id)->first();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -148,30 +153,6 @@ class FindFixture
|
||||
$update_array['bet365_id'] = $bet365_id;
|
||||
}
|
||||
|
||||
switch ($event['provider_id']) {
|
||||
case 2:
|
||||
// BETSAPI
|
||||
$update_array['betsapi_id'] = $event_id;
|
||||
break;
|
||||
case 3:
|
||||
// MAGLOO KENIA
|
||||
$update_array['magken_id'] = $event_id;
|
||||
break;
|
||||
case 4:
|
||||
// MAGLOO NIGERIA
|
||||
$update_array['magnig_id'] = $event_id;
|
||||
break;
|
||||
case 5:
|
||||
// LOGIFUTUR NIGERA
|
||||
$update_array['lognig_id'] = $event_id;
|
||||
break;
|
||||
case 6:
|
||||
// LOGIFUTUR COLOMBIA
|
||||
$update_array['logcol_id'] = $event_id;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
if ($update_array) {
|
||||
Event::where('id', $match_id)->update($update_array);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class Odds
|
||||
|
||||
$starttime = Carbon::parse($match['dt'])->toDateTimeString();
|
||||
|
||||
$event_id = Event::where('betradar_id', $betradar_id)->orWhere('magnig_id', $bmoid)->orWhere('magken_id', $bmoid)->value('id');
|
||||
$event_id = Event::where('betradar_id', $betradar_id)->value('id');
|
||||
|
||||
if ($event_id) {
|
||||
$base = [];
|
||||
@@ -80,9 +80,9 @@ class Odds
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], ['starttime' => $starttime, 'in_feed' => 1, 'bmoid' => $base['bmoid']]);
|
||||
|
||||
if ($event_id == 14190947) {
|
||||
// dd($match['M']);
|
||||
}
|
||||
// if ($event_id == 14190947) {
|
||||
// dd($match['M']);
|
||||
// }
|
||||
|
||||
foreach ($match['M'] as $magloo_bettype_id => $value) {
|
||||
switch ($magloo_bettype_id) {
|
||||
|
||||
@@ -23,37 +23,46 @@ class GenerateDefaultSetting
|
||||
Notice::note('GENERATE DEFAULT SETTING', 'b');
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('1) multiline bookmaker slots for client', 'p');
|
||||
}
|
||||
/**************************************************
|
||||
* MULTILINE SLOTS
|
||||
**************************************************/
|
||||
|
||||
$sports = Sport::where('is_active', 1)->pluck('id');
|
||||
if ($debug) {
|
||||
Notice::note('1) MULTILINE SLOTS', 'p');
|
||||
}
|
||||
|
||||
$bookmaker_slots = [1 => 6, 2 => 30, 3 => 649, 4 => 126];
|
||||
|
||||
$clients = Client::get()->pluck('id');
|
||||
$clients = Client::get();
|
||||
|
||||
foreach ($clients as $client_id) {
|
||||
foreach ($clients as $client) {
|
||||
|
||||
foreach ($sports as $sport_id) {
|
||||
foreach ($client->sport as $sport_id) {
|
||||
|
||||
$multilines = MultilineSetting::where('sport_id', $sport_id)->get()->pluck('id');
|
||||
foreach ($client->bookmaker as $client_bookmaker_id) {
|
||||
|
||||
foreach ($multilines as $multiline_id) {
|
||||
$multilines = MultilineSetting::where('sport_id', $sport_id)->get()->pluck('id');
|
||||
|
||||
foreach ($bookmaker_slots as $slot => $bookmaker_id) {
|
||||
foreach ($multilines as $multiline_id) {
|
||||
|
||||
MultilineClient::firstOrCreate(
|
||||
['client_id' => $client_id, 'sport_id' => $sport_id, 'multiline_setting_id' => $multiline_id, 'position' => $slot],
|
||||
['bookmaker_id' => $bookmaker_id, 'sort' => $slot, 'disabled' => 0]
|
||||
);
|
||||
foreach ($bookmaker_slots as $slot => $bookmaker_id) {
|
||||
|
||||
MultilineClient::firstOrCreate(
|
||||
['client_bookmaker_id' => $client_bookmaker_id, 'sport_id' => $sport_id, 'multiline_setting_id' => $multiline_id, 'position' => $slot],
|
||||
['bookmaker_id' => $bookmaker_id, 'sort' => $slot, 'disabled' => 0]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* BETTYPES for USER in MONITOR
|
||||
**************************************************/
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('2) generator bettypes im comparatore for users', 'p');
|
||||
Notice::note('2) GENERATOR BETTYPES IM COMPARATORE FOR USERS', 'p');
|
||||
}
|
||||
|
||||
$users = User::get();
|
||||
@@ -73,8 +82,12 @@ class GenerateDefaultSetting
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* COMPARING BOOKMAKER
|
||||
**************************************************/
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('3) comparing bookmaker', 'p');
|
||||
Notice::note('3) COMPARING BOOKMAKER', 'p');
|
||||
}
|
||||
|
||||
$res = Client::get();
|
||||
|
||||
@@ -58,33 +58,20 @@ class EventResource extends Resource
|
||||
->with('home')
|
||||
->with('away')
|
||||
->with('event_user_star')
|
||||
->with('event_bookmaker')
|
||||
->where('starttime', '>=', now());
|
||||
|
||||
if (auth()->user()->stars) {
|
||||
$query->whereHas('event_user_star');
|
||||
}
|
||||
|
||||
if (auth()->user()->all_only_none) {
|
||||
switch (auth()->user()->bookmaker_id) {
|
||||
case 10:
|
||||
$field = 'magnig_id';
|
||||
break;
|
||||
case 16:
|
||||
$field = 'magken_id';
|
||||
break;
|
||||
case 35:
|
||||
$field = 'lognig_id';
|
||||
break;
|
||||
case 36:
|
||||
$field = 'logcol_id';
|
||||
break;
|
||||
}
|
||||
if (auth()->user()->all_only_none > 0) {
|
||||
switch (auth()->user()->all_only_none) {
|
||||
case 1:
|
||||
$query->where($field, 1);
|
||||
$query->whereHas('event_bookmaker');
|
||||
break;
|
||||
case 2:
|
||||
$query->where($field, 0);
|
||||
$query->doesntHave('event_bookmaker');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Filament\Tables\Columns\TooltipOdds;
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\Country;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\EventUserStar;
|
||||
use App\Models\Group;
|
||||
use App\Models\Sport;
|
||||
@@ -33,6 +34,7 @@ use Filament\Tables\Filters\Indicator;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class EventsTable
|
||||
{
|
||||
@@ -164,7 +166,7 @@ class EventsTable
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->label('Draw No Bet'),
|
||||
|
||||
])->searchable(['id', 'home.name', 'away.name', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id', 'magnig_id', 'magken_id', 'lognig_id', 'logcol_id'])
|
||||
])->searchable(['id', 'home.name', 'away.name', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id', 'event_bookmaker.event_id'])
|
||||
->defaultSort('starttime', 'ASC')
|
||||
->extremePaginationLinks()
|
||||
->filters([
|
||||
@@ -349,7 +351,7 @@ class EventsTable
|
||||
->recordActions([
|
||||
Action::make('star')
|
||||
->iconButton()
|
||||
// ->color('gray')
|
||||
->color('gray')
|
||||
->icon(function ($record) {
|
||||
if (isset($record->event_user_star->id)) {
|
||||
return 'phosphor-star-fill';
|
||||
@@ -377,6 +379,14 @@ class EventsTable
|
||||
->icon('phosphor-arrow-square-out')
|
||||
->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->id]))
|
||||
->openUrlInNewTab(),
|
||||
Action::make('swap_elements')
|
||||
->icon('phosphor-swap')
|
||||
->action(function ($record, $livewire) {
|
||||
EventBookmaker::where('event_id', $record->id)->where('bookmaker_id', auth()->user()->bookmaker_id)->update(['is_swopped' => DB::raw('!is_swopped')]);
|
||||
|
||||
$livewire->dispatch('refreshBettypeMenu');
|
||||
}),
|
||||
|
||||
])->iconButton()
|
||||
->icon('phosphor-dots-three-vertical'),
|
||||
])->toolbarActions([
|
||||
|
||||
@@ -39,6 +39,7 @@ class LoadMultiline
|
||||
}
|
||||
|
||||
$res = MultilineClient::with('multiline_setting')
|
||||
->where('client_bookmaker_id', auth()->user()->bookmaker_id)
|
||||
->select('bookmaker_id', 'multiline_setting_id')
|
||||
->orderBy('sort')
|
||||
->get();
|
||||
|
||||
@@ -43,32 +43,10 @@ class LoadEvents
|
||||
case 2:
|
||||
// BETSAPI
|
||||
return $query->where('betsapi_id', 0);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Magloo Kenia
|
||||
return $query->where('magken_id', 0);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// Magloo Nigeria
|
||||
return $query->where('magnig_id', 0);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
// Logifuture Nigeria
|
||||
return $query->where('lognig_id', 0);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
// Magloo Colombia
|
||||
return $query->where('logcol_id', 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return $query->where('betradar_id', 0);
|
||||
return $query->with('event_bookmaker')->doesntHave('event_bookmaker');
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ namespace App\Livewire\Mapper;
|
||||
use App\Models\CompetitionGroupProvider;
|
||||
use App\Models\ElementProvider;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\Mapper;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
@@ -26,10 +27,6 @@ class StoreMapped
|
||||
"bet365_id" => 0
|
||||
"_1xbet_id" => 0
|
||||
"bwin_id" => 0
|
||||
"magnig_id" => 0
|
||||
"magken_id" => 0
|
||||
"lognig_id" => 0
|
||||
"logcol_id" => 0
|
||||
"starttime" => "2026-01-02 13:00:00"
|
||||
"sport_id" => 1
|
||||
"country_id" => 365
|
||||
@@ -79,27 +76,41 @@ class StoreMapped
|
||||
switch ($mapper->provider_id) {
|
||||
case 2:
|
||||
// BETSAPI
|
||||
$event->betradar_id = $mapper->betradar_id ?? 0;
|
||||
$event->betsapi_id = $mapper->event_id;
|
||||
$event->bet365_id = $mapper->bet365_id ?? 0;
|
||||
break;
|
||||
case 3:
|
||||
// MAGLOO KENIA
|
||||
$event->magken_id = $mapper->event_id;
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $arguments['id'],
|
||||
'bookmaker_id' => 16,
|
||||
], ['starttime' => $mapper->starttime, 'in_feed' => 1, 'bmoid' => $mapper->event_id, 'is_swopped' => $swopped]);
|
||||
break;
|
||||
case 4:
|
||||
// MAGLOO NIGERIA
|
||||
$event->magnig_id = $mapper->event_id;
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $arguments['id'],
|
||||
'bookmaker_id' => 10,
|
||||
], ['starttime' => $mapper->starttime, 'in_feed' => 1, 'bmoid' => $mapper->event_id, 'is_swopped' => $swopped]);
|
||||
break;
|
||||
case 5:
|
||||
// LOGIFUTUR NIGERA
|
||||
$event->lognig_id = $mapper->event_id;
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $arguments['id'],
|
||||
'bookmaker_id' => 35,
|
||||
], ['starttime' => $mapper->starttime, 'in_feed' => 1, 'bmoid' => $mapper->event_id, 'is_swopped' => $swopped]);
|
||||
break;
|
||||
case 6:
|
||||
// LOGIFUTUR COLOMBIA
|
||||
$event->logcol_id = $mapper->event_id;
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $arguments['id'],
|
||||
'bookmaker_id' => 36,
|
||||
], ['starttime' => $mapper->starttime, 'in_feed' => 1, 'bmoid' => $mapper->event_id, 'is_swopped' => $swopped]);
|
||||
break;
|
||||
}
|
||||
if ($mapper->betradar_id) {
|
||||
$event->betradar_id = $mapper->betradar_id;
|
||||
}
|
||||
$event->save();
|
||||
|
||||
Mapper::where('event_id', $arguments['event_id'])->delete();
|
||||
|
||||
@@ -37,7 +37,8 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
||||
|
||||
public static function load_filter($sport_id)
|
||||
{
|
||||
self::$default_filter = MultilineSetting::where('sport_id', $sport_id)->orderBy('id')->pluck('id')->first();
|
||||
self::$default_filter = MultilineSetting::where('sport_id', $sport_id)
|
||||
->orderBy('id')->pluck('id')->first();
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
@@ -48,7 +49,7 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
||||
self::load_filter($this->user->sport_id);
|
||||
|
||||
return $table
|
||||
->query(MultilineClient::query()->where('sport_id', $this->user->sport_id))
|
||||
->query(MultilineClient::query()->where('client_bookmaker_id', auth()->user()->bookmaker_id)->where('sport_id', $this->user->sport_id))
|
||||
->paginated(false)
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Provider;
|
||||
use App\Models\Sport;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@@ -38,7 +39,9 @@ class TopMenuItems extends Component
|
||||
|
||||
public function swopBookmaker($bookmaker_id)
|
||||
{
|
||||
User::where('id', auth()->user()->id)->update(['bookmaker_id' => $bookmaker_id]);
|
||||
$provider_id = Provider::where('bookmaker_id', $bookmaker_id)->value('id');
|
||||
|
||||
User::where('id', auth()->user()->id)->update(['provider_id' => $provider_id, 'bookmaker_id' => $bookmaker_id]);
|
||||
|
||||
$this->js('window.location.reload()');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AlarmSetting extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -142,4 +142,9 @@ class Event extends Model
|
||||
{
|
||||
return $this->hasOne(EventUserStar::class, 'event_id', 'id')->where('user_id', auth()->user()->id);
|
||||
}
|
||||
|
||||
public function event_bookmaker()
|
||||
{
|
||||
return $this->hasOne(EventBookmaker::class, 'event_id', 'id')->where('bookmaker_id', auth()->user()->bookmaker_id);
|
||||
}
|
||||
}
|
||||
@@ -9,24 +9,26 @@ class EventBookmaker extends Model
|
||||
protected $fillable = [
|
||||
'event_id',
|
||||
'bookmaker_id',
|
||||
'starttime',
|
||||
'bmoid',
|
||||
'in_feed',
|
||||
'is_swopped',
|
||||
'send_status',
|
||||
'starttime',
|
||||
'bkm_2w',
|
||||
'bkm_2ws1',
|
||||
'bkm_3w',
|
||||
'bkm_3wht',
|
||||
'bkm_dc',
|
||||
'bkm_dbn',
|
||||
'bkm_ggng',
|
||||
'bkm_po',
|
||||
'bkm_poht',
|
||||
'bkm_poq1',
|
||||
'bkm_to',
|
||||
'bkm_toht',
|
||||
'bkm_toq1',
|
||||
'bkm_tq',
|
||||
'has_to_qualify',
|
||||
'alarm_2w',
|
||||
'alarm_2ws1',
|
||||
'alarm_3w',
|
||||
'alarm_3wht',
|
||||
'alarm_dc',
|
||||
'alarm_dbn',
|
||||
'alarm_ggng',
|
||||
'alarm_po',
|
||||
'alarm_poht',
|
||||
'alarm_poq1',
|
||||
'alarm_to',
|
||||
'alarm_toht',
|
||||
'alarm_toq1',
|
||||
'alarm_tq',
|
||||
];
|
||||
|
||||
public function event()
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Scopes\ClientScope;
|
||||
use App\Models\Scopes\SportScope;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MultilineClient extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'client_id',
|
||||
'client_bookmaker_id',
|
||||
'sport_id',
|
||||
'multiline_setting_id',
|
||||
'disabled',
|
||||
@@ -35,9 +34,6 @@ class MultilineClient extends Model
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::addGlobalScope(new ClientScope);
|
||||
|
||||
static::addGlobalScope(new SportScope);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user