wip
This commit is contained in:
1 parent
980b716271
commit
5f0fe9c010
2 files changed
+16
-23
No files matched your search
@@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Services\Tasks\Notification;
|
|
||||||
|
|
||||||
use App\Models\PersonalNotificationSend;
|
|
||||||
|
|
||||||
class StoreSend
|
|
||||||
{
|
|
||||||
public static function store($event_id, $user_id, $bookmaker_id, $alarm_level_id, $fieldname, $sendtype)
|
|
||||||
{
|
|
||||||
return PersonalNotificationSend::create([
|
|
||||||
'event_id' => $event_id,
|
|
||||||
'user_id' => $user_id,
|
|
||||||
'bookmaker_id' => $bookmaker_id,
|
|
||||||
'alarm_level_id' => $alarm_level_id,
|
|
||||||
'fieldname' => $fieldname,
|
|
||||||
(string) $sendtype => 1,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ namespace App\Console\Commands\Services\Tasks;
|
|||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Console\Commands\Services\Tasks\Notification\CheckSend;
|
use App\Console\Commands\Services\Tasks\Notification\CheckSend;
|
||||||
use App\Console\Commands\Services\Tasks\Notification\LoadAlarmEvents;
|
use App\Console\Commands\Services\Tasks\Notification\LoadAlarmEvents;
|
||||||
use App\Console\Commands\Services\Tasks\Notification\StoreSend;
|
|
||||||
use App\Mail\AlarmNotification;
|
use App\Mail\AlarmNotification;
|
||||||
use App\Models\Bookmaker;
|
use App\Models\Bookmaker;
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
@@ -58,7 +57,14 @@ class NotifyAlarms
|
|||||||
|
|
||||||
if (! $send) {
|
if (! $send) {
|
||||||
|
|
||||||
$send = StoreSend::store($event_id, $user_id, $bookmaker_id, $alarm_level_id, $fieldname, 'notify_by_mail');
|
$send = PersonalNotificationSend::create([
|
||||||
|
'event_id' => $event_id,
|
||||||
|
'user_id' => $user_id,
|
||||||
|
'bookmaker_id' => $bookmaker_id,
|
||||||
|
'alarm_level_id' => $alarm_level_id,
|
||||||
|
'fieldname' => $fieldname,
|
||||||
|
'notify_by_mail' => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
switch ($alarm_level_id) {
|
switch ($alarm_level_id) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -95,7 +101,14 @@ class NotifyAlarms
|
|||||||
|
|
||||||
if (! $send) {
|
if (! $send) {
|
||||||
|
|
||||||
$send = StoreSend::store($event_id, $user_id, $bookmaker_id, $alarm_level_id, $fieldname, 'notify_by_system');
|
$send = PersonalNotificationSend::create([
|
||||||
|
'event_id' => $event_id,
|
||||||
|
'user_id' => $user_id,
|
||||||
|
'bookmaker_id' => $bookmaker_id,
|
||||||
|
'alarm_level_id' => $alarm_level_id,
|
||||||
|
'fieldname' => $fieldname,
|
||||||
|
'notify_by_system' => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
switch ($alarm_level_id) {
|
switch ($alarm_level_id) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
Reference in new issue
Block a user