affiliate_logs.blade.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. @extends('backend.layouts.app')
  2. @section('content')
  3. <div class="card">
  4. <div class="card-header">
  5. <h5 class="mb-0 h6">{{translate('Affiliate Logs')}}</h5>
  6. </div>
  7. <div class="card-body">
  8. <table class="table aiz-table mb-0">
  9. <thead>
  10. <tr>
  11. <th>#</th>
  12. <th data-breakpoints="lg">{{ translate('Referred By')}}</th>
  13. <th>{{ translate('Referral User')}}</th>
  14. <th>{{ translate('Amount')}}</th>
  15. <th data-breakpoints="lg">{{ translate('Order Id')}}</th>
  16. <th data-breakpoints="lg">{{ translate('Referral Type') }}</th>
  17. <th data-breakpoints="lg">{{ translate('Product') }}</th>
  18. <th data-breakpoints="lg">{{ translate('Note') }}</th>
  19. <th data-breakpoints="lg">{{ translate('Date') }}</th>
  20. </thead>
  21. <tbody>
  22. @foreach($affiliate_logs as $key => $affiliate_log)
  23. @if ($affiliate_log->user != null)
  24. <tr>
  25. <td>{{ ($key+1) + ($affiliate_logs->currentPage() - 1)*$affiliate_logs->perPage() }}</td>
  26. <td>
  27. {{ optional(\App\Models\User::where('id', $affiliate_log->referred_by_user)->first())->email }}
  28. </td>
  29. <td>
  30. @if($affiliate_log->user_id !== null)
  31. {{ optional($affiliate_log->user)->email }}
  32. @else
  33. {{ translate('Guest').' ('. $affiliate_log->guest_id.')' }}
  34. @endif
  35. </td>
  36. <td>{{ single_price($affiliate_log->amount) }}</td>
  37. <td>
  38. @if($affiliate_log->order_id != null)
  39. @if($affiliate_log->order != null)
  40. {{ optional($affiliate_log->order)->code }}
  41. @else
  42. {{ $affiliate_log->order_id }}
  43. @endif
  44. @else
  45. {{ optional($affiliate_log->order_detail->order)->code }}
  46. @endif
  47. </td>
  48. <td> {{ ucwords(str_replace('_',' ', $affiliate_log->affiliate_type)) }}</td>
  49. <td>
  50. @if($affiliate_log->order_detail_id != null && $affiliate_log->order_detail)
  51. {{ optional($affiliate_log->order_detail->product)->name }}
  52. @endif
  53. </td>
  54. <td>{{ $affiliate_log->note }} </td>
  55. <td>{{ $affiliate_log->created_at->format('d, F Y') }} </td>
  56. </tr>
  57. @endif
  58. @endforeach
  59. </tbody>
  60. </table>
  61. <div class="aiz-pagination">
  62. {{ $affiliate_logs->links() }}
  63. </div>
  64. </div>
  65. </div>
  66. @endsection