@php $all_contact = 0; $all_order_done = 0; if(count($customer_status)){ foreach ($customer_status as $item){ $total_order_status[$item->id] = 0; } } @endphp
| @if(count($customer_status)) @foreach($customer_status as $item) | {{$item->name}} | @endforeach @endif|||||||
|---|---|---|---|---|---|---|---|---|
| STT | Sale | Tổng contact | Tổng chốt đơn | Tổng tác nghiệp | Tổng tỷ lệ | @if(count($customer_status)) @foreach($customer_status as $item)Chốt đơn | Tỷ lệ chốt | @endforeach @endif|
| {{$key+1}} | {{@$item->name}} | {{@$item->statuses['all_contact']}} | {{@$item->statuses['all_order_done']}} | {{@$item->tac_nghiep}} | {{--{{@round(($item->statuses['all_order_done']/$item->statuses['all_contact'])*100)}} % | --}}{{!empty($item->statuses['all_order_done']) && !empty($item->statuses['all_contact']) ? @round(($item->statuses['all_order_done']/$item->statuses['all_contact'])*100) : 0}} % | @if(count($customer_status)) @foreach($customer_status as $key => $item1) @php $count = isset($item->statuses[$item1->id]['order_done']) ? $item->statuses[$item1->id]['order_done']:0; if ( $total_order_status[$item1->id]){ $total_order_status[$item1->id] = $total_order_status[$item1->id] + $count; }else{ $total_order_status[$item1->id] = $count; } @endphp{{@$item->statuses[$item1->id]['order_done']}} | {{!empty($item->statuses[$item1->id]['order_done'])&&!empty($item->statuses['all_contact'])? round($item->statuses[$item1->id]['order_done']/$item->statuses['all_contact']*100):0}} % | @endforeach @endif
| TỔNG CỘNG | {{$all_contact}} | {{$all_order_done}} | {{!empty($all_order_done) && !empty($all_contact) ? @round(($all_order_done/$all_contact)*100) : 0}} % | {{--{{dd($total_order_status)}}--}} @if(count($customer_status)) @foreach($customer_status as $key => $item){{@$total_order_status[$item->id]}} | {{!empty($total_order_status[$item->id]) && !empty($all_contact) ? @round(($total_order_status[$item->id]/$all_contact)*100) : 0}} % | @endforeach @endif|||