comparing wip

This commit is contained in:
salam committed 2026-01-25 17:26:09 +01:00
1 parent 0cf815c00f
commit cfee6f6b99
23 files changed
+740 -370

No files matched your search

@@ -13,49 +13,39 @@ class LoadMultiline
public static function load()
{
// if (EventsTable::$user->sport_id == 1) {
// $cb = ComparingBookmaker::where('sport_id', 1)->where('client_bookmaker_id', EventsTable::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray();
// } else {
// $cb = ComparingBookmaker::where('sport_id', '!=', 1)->where('client_bookmaker_id', EventsTable::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray();
// }
$cb = ComparingBookmaker::where('sport_id', EventsTable::$user->sport_id)->where('client_bookmaker_id', EventsTable::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray();
$cb = ComparingBookmaker::where('sport_id', EventsTable::$user->sport_id)
->where('client_bookmaker_id', EventsTable::$user->bookmaker_id)
->orderBy('sorting')
->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')
->get();
$bookmakers = [];
$filter = [];
foreach ($cb as $value) {
$bookmakers[] = $value['bookmaker_id'];
$filter[$value['bookmaker_id']] = [
'time_lastcheck' => $value['time_lastcheck'],
'margin' => $value['margin_threshold'],
];
if (EventsTable::$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', EventsTable::$user->sport_id)->get();
foreach ($res as $value) {
EventsTable::$filter[$value->table] = $filter;
if (EventsTable::$user->is_multiline_direct) {
EventsTable::$slots[$value->table] = $bookmakers;
array_unshift(EventsTable::$slots[$value->table], EventsTable::$user->bookmaker_id);
}
EventsTable::$bookmaker[$value->table] = $bookmakers;
}
if (! EventsTable::$user->is_multiline_direct) {
$res = MultilineClient::with('multiline_setting')
->select('bookmaker_id', 'multiline_setting_id')
->orderBy('sort')
->get();
$res = MultilineClient::with('multiline_setting')
->select('bookmaker_id', 'multiline_setting_id')
->orderBy('sort')
->get();
foreach ($res as $value) {
$table = $value->multiline_setting->table;
if (! isset(EventsTable::$slots[$table])) {
EventsTable::$slots[$table][] = (int) EventsTable::$user->bookmaker_id;
}
EventsTable::$slots[$table][] = (int) $value->bookmaker_id;
}
foreach ($res as $value) {
$table = $value->multiline_setting->table;
EventsTable::$slots[$table][] = (int) $value->bookmaker_id;
}
}
}