Pārlūkot izejas kodu

Update Report model

Daniel Supernault 6 gadi atpakaļ
vecāks
revīzija
9f29ab9338
1 mainītis faili ar 9 papildinājumiem un 8 dzēšanām
  1. 9 8
      app/Report.php

+ 9 - 8
app/Report.php

@@ -22,14 +22,15 @@ class Report extends Model
     {
     {
         $class = $this->object_type;
         $class = $this->object_type;
         switch ($class) {
         switch ($class) {
-        case 'App\Status':
-         $column = 'id';
-          break;
-
-        default:
-         $column = 'id';
-          break;
-      }
+            case 'App\Status':
+             $column = 'id';
+              break;
+
+            default:
+             $class = 'App\Status';
+             $column = 'id';
+              break;
+        }
 
 
         return (new $class())->where($column, $this->object_id)->firstOrFail();
         return (new $class())->where($column, $this->object_id)->firstOrFail();
     }
     }