Alexander Musikhin преди 3 седмици
родител
ревизия
8eb29d7809

+ 1 - 1
app/Jobs/NotifyManagerChangeStatusJob.php

@@ -24,7 +24,7 @@ class NotifyManagerChangeStatusJob implements ShouldQueue
     {
         $title = 'Изменён статус площадки';
         $body = 'Площадка ' . $this->order->common_name . '. Статус: ' . $this->order->orderStatus->name;
-        if(!is_null($this->order->user->token_fcm)) {
+        if(!is_null($this?->order?->user?->token_fcm)) {
             $this->order->user->notify(new FireBaseNotification($title, $body));
         }
 

+ 1 - 1
app/Jobs/NotifyManagerNewOrderJob.php

@@ -24,7 +24,7 @@ class NotifyManagerNewOrderJob implements ShouldQueue
     {
         $title = 'Новая площадка!';
         $body = 'Площадка ' . $this->order->common_name . '. Статус: ' . $this->order->orderStatus->name;
-        if(!is_null($this->order->user->token_fcm)) {
+        if(!is_null($this?->order?->user?->token_fcm)) {
             $this->order->user->notify(new FireBaseNotification($title, $body));
         }
     }

+ 2 - 2
app/Jobs/NotifyOrderInScheduleJob.php

@@ -34,8 +34,8 @@ class NotifyOrderInScheduleJob implements ShouldQueue
         }
 
         if(!is_null($this->schedule->order_id)) {
-            $order = Order::query()->where('id', $this->schedule->order_id)->first();
-            if(!is_null($order->user->token_fcm)) {
+            $order = Order::query()->withoutGlobalScopes()->where('id', $this->schedule->order_id)->first();
+            if(!is_null($order?->user?->token_fcm)) {
                 $order->user->notify(new FireBaseNotification($title, $body));
             }
 

+ 1 - 2
app/Services/GenerateDocumentsService.php

@@ -25,7 +25,6 @@ class GenerateDocumentsService
 {
     const INSTALL_FILENAME = 'Монтаж ';
     const HANDOVER_FILENAME = 'Сдача ';
-
     const RECLAMATION_FILENAME = 'Рекламация ';
 
     /**
@@ -646,7 +645,7 @@ class GenerateDocumentsService
 
     public function generateTtnPack(Ttn $ttn, int $userId): string
     {
-        $skus = ProductSKU::query()->whereIn('id', json_decode($ttn->skus))->get();
+        $skus = ProductSKU::query()->withoutGlobalScopes()->whereIn('id', json_decode($ttn->skus))->get();
         $volume = $weight = $places = 0;
         foreach ($skus as $sku) {
             if(!isset($order)) {