This commit is contained in:
salam committed 2026-01-26 18:26:02 +01:00
1 parent 9ca5657827
commit 6f3d608704
47 files changed
+1005 -145

No files matched your search

@@ -0,0 +1,29 @@
<?php
namespace App\Console\Commands\Services\Tasks\Alarm;
use Illuminate\Support\Facades\DB;
class AlarmLoadOdds
{
public static function get($event_id, $table, $oddnames)
{
$res = DB::table($table)->where('flags', 1)->where('event_id', $event_id)->get();
$odds = explode(',', $oddnames);
$arr = [];
foreach ($res as $value) {
if ($table == 'odds_dc') {
$arr[(int) $value->bookmaker_id]['margin'] = (float) $value->margin * 2;
} else {
$arr[(int) $value->bookmaker_id]['margin'] = (float) $value->margin;
}
foreach ($odds as $odd) {
$arr[(int) $value->bookmaker_id][$odd] = (float) $value->$odd;
}
}
return $arr;
}
}