소스 검색

Added missed fields.

Kain_Stropov 5 년 전
부모
커밋
9afa86ac7b
4개의 변경된 파일23개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      app/HttpModels/LobbyModel.php
  2. 3 0
      app/HttpModels/MeetingWithLobbyModel.php
  3. 13 0
      app/Models/LobbyPro.php
  4. 5 0
      app/Models/Meeting.php

+ 2 - 0
app/HttpModels/LobbyModel.php

@@ -7,6 +7,7 @@ class LobbyModel extends ClientLobbyModel {
     public $isStrangerAccessible;
     public $isClientAccessible;
     public $isActive;
+    public $lobbyProAccessLevel;
     public $meetings = [];
 
     public function __construct(Lobby $lobby)
@@ -15,6 +16,7 @@ class LobbyModel extends ClientLobbyModel {
         $this->isStrangerAccessible = $lobby->is_stranger_accessible;
         $this->isClientAccessible = $lobby->is_client_accessible;
         $this->isActive = $lobby->is_active;
+        $this->lobbyProAccessLevel = $lobby->lobby_pro_access_level;
         foreach ($lobby->meetings()->where('meeting.is_active',true)->get() as $meeting) {
             $this->meetings[] = new MeetingModel($meeting);
         }

+ 3 - 0
app/HttpModels/MeetingWithLobbyModel.php

@@ -6,11 +6,14 @@ use App\Models\Meeting;
 class MeetingWithLobbyModel extends MeetingModel {
 
     public $lobby;
+    public $targetPro;
 
     public function __construct(Meeting $meeting)
     {
         parent::__construct($meeting);
 
         $this->lobby = new ClientLobbyModel($meeting->lobby);
+        if ($meeting->target_lobby_pro_id)
+            $this->targetPro = new LobbyProModel($meeting->targetLobbyPro->pro);
     }
 }

+ 13 - 0
app/Models/LobbyPro.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class LobbyPro extends Model
+{
+    public function pro()
+    {
+        return $this->belongsTo(Pro::class);
+    }
+}

+ 5 - 0
app/Models/Meeting.php

@@ -19,4 +19,9 @@ class Meeting extends Model
     {
         return $this->belongsTo(Lobby::class);
     }
+
+    public function targetLobbyPro()
+    {
+        return $this->belongsTo(LobbyPro::class, 'target_lobby_pro_id');
+    }
 }