wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Events\Tables\Tools;
|
||||
|
||||
use App\Filament\Resources\Events\Tables\EventsTable;
|
||||
use App\Models\ComparingBookmaker;
|
||||
use App\Models\MultilineClient;
|
||||
use App\Models\MultilineSetting;
|
||||
|
||||
class LoadMultiline
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
$cb = ComparingBookmaker::where('sport_id', auth()->user()->sport_id)
|
||||
->where('client_bookmaker_id', auth()->user()->bookmaker_id)
|
||||
->orderBy('sorting', 'desc')
|
||||
->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')
|
||||
->get();
|
||||
|
||||
$bookmakers = [];
|
||||
$filter = [];
|
||||
foreach ($cb as $value) {
|
||||
if (auth()->user()->bookmaker_id != $value->bookmaker_id) {
|
||||
$bookmakers[] = $value->bookmaker_id;
|
||||
$filter[$value->bookmaker_id] = [
|
||||
'time_lastcheck' => $value->time_lastcheck,
|
||||
'margin' => $value->margin_threshold,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$res = MultilineSetting::where('sport_id', auth()->user()->sport_id)->get();
|
||||
|
||||
foreach ($res as $value) {
|
||||
EventsTable::$filter[$value->table] = $filter;
|
||||
EventsTable::$bookmaker[$value->table] = $bookmakers;
|
||||
}
|
||||
|
||||
$res = MultilineClient::with('multiline_setting')
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('client_bookmaker_id', auth()->user()->bookmaker_id)
|
||||
->select('bookmaker_id', 'multiline_setting_id')
|
||||
->orderBy('sort')
|
||||
->get();
|
||||
|
||||
foreach ($res as $value) {
|
||||
$table = $value->multiline_setting->table;
|
||||
EventsTable::$slots[$table][] = (int) $value->bookmaker_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user