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