Alexander Musikhin há 2 semanas atrás
pai
commit
ce22811b05
1 ficheiros alterados com 14 adições e 6 exclusões
  1. 14 6
      resources/views/orders/show.blade.php

+ 14 - 6
resources/views/orders/show.blade.php

@@ -230,17 +230,25 @@
                                             @endif
                                         </td>
                                         <td>
-                                            <a href="{{ route('product_sku.show', ['product_sku' =>$p, 'previous_url' => url()->current()]) }}">
+                                            @if(hasRole('admin'))
+                                                <a href="{{ route('product_sku.show', ['product_sku' =>$p, 'previous_url' => url()->current()]) }}">
+                                                    {!! $p->product->article !!}
+                                                </a>
+                                                <br>
+                                                <a class="small"
+                                                   href="{{ route('catalog.show', ['product' => $p->product, 'previous_url' => request()->fullUrl()]) }}">каталог</a>
+                                            @else
                                                 {!! $p->product->article !!}
-                                            </a>
-                                            <br>
-                                            <a class="small" href="{{ route('catalog.show', ['product' => $p->product, 'previous_url' => request()->fullUrl()]) }}">каталог</a>
-
+                                            @endif
                                         </td>
                                         <td>{!! $p->product->nomenclature_number !!}</td>
                                         <td>{{ $p->status }}</td>
                                         <td>
-                                            <a href="{{ route('maf_order.show', $p->maf_order) }}">{{ $p->maf_order->order_number }}</a>
+                                            @if($p->maf_order_id && hasRole('admin'))
+                                                <a href="{{ route('maf_order.show', $p->maf_order) }}">{{ $p->maf_order->order_number }}</a>
+                                            @else
+                                                {{ $p->maf_order?->order_number }}
+                                            @endif
                                         </td>
                                         <td>{{ $p->rfid }}</td>
                                         <td>{{ $p->factory_number }}</td>