notification & notes wip

This commit is contained in:
salam committed 2026-02-01 16:36:27 +01:00
1 parent 94a3c6c472
commit 155177045b
30 files changed
+426 -320

No files matched your search

+11 -11
View File
@@ -3,7 +3,6 @@
namespace App\Actions;
use App\Models\Event;
use App\Models\EventBookmaker;
use App\Models\OddsTable;
class AlarmStatistic
@@ -16,19 +15,21 @@ class AlarmStatistic
$fields[$value->name] = explode(',', $value->fieldnames);
}
$event_ids = Event::where('sport_id', auth()->user()->sport_id)->where('starttime', '>=', now())->pluck('id')->toArray();
$res = EventBookmaker::select('alarm_2w_h2w', 'alarm_2w_a2w', 'alarm_2ws1_h2w', 'alarm_2ws1_a2w', 'alarm_3w_h3w', 'alarm_3w_d3w', 'alarm_3w_a3w', 'alarm_3wht_h3w', 'alarm_3wht_d3w', 'alarm_3wht_a3w', 'alarm_dc_dc1x', 'alarm_dc_dc12', 'alarm_dc_dcx2', 'alarm_dbn_dnb1', 'alarm_dbn_dnb2', 'alarm_ggng_gg', 'alarm_ggng_ng', 'alarm_po_home', 'alarm_po_away', 'alarm_poht_home', 'alarm_poht_away', 'alarm_poq1_home', 'alarm_poq1_away', 'alarm_to_over', 'alarm_to_under', 'alarm_toht_over', 'alarm_toht_under', 'alarm_toq1_over', 'alarm_toq1_under', 'alarm_tq_htq', 'alarm_tq_atq')
->whereIn('event_id', $event_ids)
->where('bookmaker_id', auth()->user()->bookmaker_id)
->get()
->toArray();
$events = Event::with('event_bookmaker')
->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>=', now())
->whereHas('event_bookmaker', function ($query) {
$query->where('bookmaker_id', auth()->user()->bookmaker_id);
})
->get();
$arr = [];
foreach ($res as $value) {
foreach ($events as $event) {
$row = $event->event_bookmaker;
// $row = get_object_vars($event->toArray());
foreach ($fields as $table => $names) {
foreach ($names as $name) {
$val = (int) $value[$name];
$val = (int) $row[$name];
if ($val) {
if (isset($arr[$table][$val])) {
$arr[$table][$val]++;
@@ -37,7 +38,6 @@ class AlarmStatistic
}
}
}
}
}