Procházet zdrojové kódy

Client pro changes list - show creator

Vijayakrishnan před 3 roky
rodič
revize
530438ab4b

+ 3 - 0
app/Models/ClientProChange.php

@@ -23,4 +23,7 @@ class ClientProChange extends Model
     public function newPro(){
         return $this->hasOne(Pro::class, 'id', 'new_pro_id');
     }
+    public function creator(){
+        return $this->hasOne(Pro::class, 'id', 'created_by_pro_id');
+    }
 }

+ 10 - 2
resources/views/app/patient/client-pro-changes.blade.php

@@ -13,7 +13,11 @@
                     <th class="border-0 text-secondary width-200px">Old Pro</th>
                     <th class="border-0 text-secondary width-200px">New Pro</th>
                     <th class="border-0 text-secondary width-200px">Change Memo</th>
-                    <th></th>
+                    <th class="border-0 text-secondary">
+                        @if($pro->pro_type === 'ADMIN')
+                            Created By
+                        @endif
+                    </th>
                 </tr>
                 </thead>
                 <tbody>
@@ -24,7 +28,11 @@
                         <td>{{$change->previousPro ? $change->previousPro->displayName() : '-'}}</td>
                         <td>{{$change->newPro ? $change->newPro->displayName() : '-'}}</td>
                         <td>{{$change->custom_memo}}</td>
-                        <td></td>
+                        <td>
+                            @if($pro->pro_type === 'ADMIN' && $change->creator)
+                                {{$change->creator->displayName()}}
+                            @endif
+                        </td>
                     </tr>
                 @endforeach
                 </tbody>