wip del err
This commit is contained in:
1 parent
812736ca9a
commit
9bcd4432c6
1210 files changed
-220941
No files matched your search
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Services\Tasks\Notification;
|
||||
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\OddsTable;
|
||||
use App\Models\PersonalNotification;
|
||||
|
||||
class LoadAlarmEvents
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
$map = OddsTable::alarm_fieldnames_by_sport();
|
||||
|
||||
$users = PersonalNotification::where('notify_by_system', 1)->orwhere('notify_by_email', 1)->orderby('bookmaker_id')->get();
|
||||
|
||||
$alarms = [];
|
||||
|
||||
foreach ($users as $user) {
|
||||
|
||||
$events = EventBookmaker::where('bookmaker_id', $user->bookmaker_id)->get();
|
||||
|
||||
foreach ($events as $event) {
|
||||
|
||||
foreach ($map[$event->sport_id] as $field) {
|
||||
if ($event[$field] == $user->alarm_level_id) {
|
||||
if ($user->notify_by_system) {
|
||||
$alarms[$event->event_id][$user->user_id][$user->bookmaker_id]['system'][$field] = $event[$field];
|
||||
}
|
||||
if ($user->notify_by_email) {
|
||||
$alarms[$event->event_id][$user->user_id][$user->bookmaker_id]['mail'][$field] = $event[$field];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $alarms;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user