@if(count($teams) > 1)
{{$teams[1]['name']}}
  {{number_format($teams[1]['sum_all_price_done'])}}
 {{$teams[1]['all_customer_team'] > 0 ? number_format(($teams[1]['sum_all_order_done']/$teams[1]['all_customer_team'])*100) : 0}} %
@endif @if(count($teams))
{{$teams[0]['name']}}
  {{number_format($teams[0]['sum_all_price_done'])}}
 {{ $teams[0]['all_customer_team'] > 0 ? number_format(($teams[0]['sum_all_order_done']/$teams[0]['all_customer_team'])*100) : 0}} %
@endif @if(count($teams) > 2)
{{$teams[2]['name']}}
  {{number_format($teams[2]['sum_all_price_done'])}}
 {{ $teams[2]['all_customer_team'] > 0 ? number_format(($teams[2]['sum_all_order_done']/$teams[2]['all_customer_team'])*100) : 0}} %
@endif
@if(count($teams)) @foreach($teams as $key => $item) @if($key > 2) @endif @endforeach @endif
# Tên nhóm Doanh số Tỷ lệ chốt
{{$key+1}} {{----}} {{$item['name']}} {{number_format($item['sum_all_price_done'])}} {{$item['all_customer_team'] > 0 ? @round($item['sum_all_order_done']/$item['all_customer_team']*100,2) : 0}} %
@if(count($sales) > 1)
{{$sales[1]['name']}}
  {{number_format($sales[1]['sum_price_done'])}}
 {{$sales[1]['all_customer'] > 0 ? @round($sales[1]['sum_order_done']/$sales[1]['all_customer']*100) : 0}} %
@endif @if(count($sales))
{{$sales[0]['name']}}
  {{number_format($sales[0]['sum_price_done'])}}
 {{$sales[0]['all_customer'] > 0 ? round($sales[0]['sum_order_done']/$sales[0]['all_customer']*100,2) : 0}} %
@endif @if(count($sales) > 2)
{{$sales[2]['name']}}
  {{number_format($sales[2]['sum_price_done'])}}
 {{$sales[2]['all_customer'] > 0 ? @round($sales[2]['sum_order_done']/$sales[2]['all_customer']*100,2) : 0}} %
@endif
@if(count($sales)>2) @foreach($sales as $key => $item) @if($key > 2) @endif @endforeach @endif
# Tên nhân viên Doanh số Tỷ lệ chốt
{{$key+1}} {{----}} {{$item['name']}} {{number_format($item['sum_price_done'])}} {{$item['all_customer'] > 0 ? round($item['sum_order_done']/$item['all_customer']*100,2) : 0}} %
@if(count($marketings) > 1) {{--{{dd($marketings)}}--}}
{{$marketings[1]['name']}}
  {{number_format($marketings[1]['sum_price_done'])}}
 {{$marketings[1]['all_customer']}}
@endif @if(count($marketings))
{{$marketings[0]['name']}}
  {{number_format($marketings[0]['sum_price_done'])}}
  {{$marketings[0]['all_customer']}}
@endif @if(count($marketings) > 2)
{{$marketings[2]['name']}}
  {{number_format($marketings[2]['sum_price_done'])}}
 {{$marketings[2]['all_customer']}}
@endif
@if(count($marketings) > 3) @foreach($marketings as $key => $item) @if($key > 2) @endif @endforeach @endif
# Tên nhân viên Doanh số Contact
{{$key+1}} {{----}} {{$item['name']}} {{number_format($item['sum_price_done'])}} {{$item['all_customer']}}