@php $affiliates = $datas['affiliates']; $total_money = $datas['total_money']; $total_paid = $datas['total_paid'] @endphp @foreach($affiliates as $index=>$data) @endforeach
# Khách hàng Dịch vụ Tổng chi Hoa hồng
{{$index + 1}} {{$data->invited_name}} {{$data->service_name}} {{number_format($data->price)}} {{number_format($data->price * ($data->value / 100))}}
@if(count($affiliates) > 0)
Tổng hoa hồng: {{number_format($total_money->total_affiliate)}} đ
Đã thanh toán: {{number_format($total_paid ? $total_paid->total_paid : 0)}} đ
Số dư: {{number_format($total_money->total_affiliate - ($total_paid ? $total_paid->total_paid : 0))}} đ
@endif
{{$affiliates->links()}}