toggle difference s book and partner; remove sport froma larm filter
This commit is contained in:
1 parent
7c0fd2b7a0
commit
4e64f2f318
12 files changed
+84
-90
No files matched your search
@@ -185,25 +185,18 @@ class GenerateSetting
|
||||
|
||||
$users = User::with('client')->get();
|
||||
foreach ($users as $user) {
|
||||
if (in_array($user->id, [1, 2])) {
|
||||
$sports = Sport::where('is_active', 1)->pluck('id')->toArray();
|
||||
} else {
|
||||
$sports = Client::find($user->client_id)->value('sport');
|
||||
}
|
||||
foreach ($sports as $sport_id) {
|
||||
foreach ($alarm_levels as $alarm_level) {
|
||||
foreach ($alarm_levels as $alarm_level) {
|
||||
|
||||
PersonalNotification::firstOrCreate(
|
||||
['user_id' => $user->id, 'bookmaker_id' => $user->bookmaker_id, 'alarm_level_id' => $alarm_level->id],
|
||||
['notify_by_system' => 0, 'notify_by_email' => 0]
|
||||
);
|
||||
|
||||
if ($user->partner_bookmaker_id) {
|
||||
PersonalNotification::firstOrCreate(
|
||||
['sport_id' => $sport_id, 'user_id' => $user->id, 'bookmaker_id' => $user->bookmaker_id, 'alarm_level_id' => $alarm_level->id],
|
||||
['user_id' => $user->id, 'bookmaker_id' => $user->partner_bookmaker_id, 'alarm_level_id' => $alarm_level->id],
|
||||
['notify_by_system' => 0, 'notify_by_email' => 0]
|
||||
);
|
||||
|
||||
if ($user->partner_bookmaker_id) {
|
||||
PersonalNotification::firstOrCreate(
|
||||
['sport_id' => $sport_id, 'user_id' => $user->id, 'bookmaker_id' => $user->partner_bookmaker_id, 'alarm_level_id' => $alarm_level->id],
|
||||
['notify_by_system' => 0, 'notify_by_email' => 0]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user