排行 | @if($select['query']['tag'] == 'customer_id')销售组 | 负责人 | @endif @if($select['query']['tag']=='city_id')省份 | 城市 | @else客户编码 | 客户名称 | 销售等级 | @endif比去年同期增长率 | 比去年同期增长额 | 总销售额 | 销售额占区域比 | 增长额总销售贡献比 | 增长贡献率 | @foreach($categorys['name'] as $category){{$category['name']}} | @endforeach [], // 今年比去年同期增加额正数求和 'b' => [], // 今年比去年同期增加额负数求和 'c' => [] ]; foreach((array)$this_year_data as $k => $v) { $res = $v - $last_year_data[$k]; $growth['a'][$k] += $res; // 正数求和 if($res > 0) { $growth['b'][$k] += $res; } // 负数求和 if($res < 0) { $growth['c'][$k] += $res; } } $this_year_sum = array_sum((array)$this_year_data); $last_year_sum = array_sum((array)$last_year_data); $growth_a = array_sum($growth['a']); $growth_b = array_sum($growth['b']); $growth_c = array_sum($growth['c']); ?> @foreach($this_year_data as $k => $v)
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{$i}} | @if($select['query']['tag'] == 'customer_id'){{$regions[$single['info'][$k]['region_id']]['name']}} | {{get_user($regions[$single['info'][$k]['region_id']]['owner_user_id'], 'name')}} | @endif @if($select['query']['tag'] == 'city_id'){{$single['info'][$k]['province_name']}} | {{$single['info'][$k]['city_name']}} | @else{{$single['info'][$k]['customer_code']}} | 32877) { $post_type = '军'; } elseif ($grade > 16438) { $post_type = '师'; } elseif ($grade > 6575) { $post_type = '旅'; } elseif ($grade > 3288) { $post_type = '团'; } elseif ($grade > 1643) { $post_type = '营'; } elseif ($grade > 657) { $post_type = '连'; } else { $post_type = '问题'; } } else if($post == 2) { if ($grade > 3288) { $post_type = '大队'; } elseif ($grade > 1643) { $post_type = '中队'; } elseif ($grade > 657) { $post_type = '小队'; } elseif ($grade > 328) { $post_type = '分队'; } else { $post_type = '问题'; } } ?> {{$single['info'][$k]['customer_name']}} | {{$post_type}} | @endif@if($last_year_data[$k] > 0) {{$last_year_pre}}% @else 去年同期无 @endif | {{number_format($growth['a'][$k], 2)}} | {{number_format($this_year_data[$k], 2)}} | {{number_format(($v / array_sum($this_year_data) * 100), 2)}}% | {{number_format(($growth['a'][$k] / array_sum($this_year_data) * 100), 2)}}% | 0) { echo number_format(($growth['a'][$k] / $growth_b) * 100, 2); } else { echo '-'.number_format(($growth['a'][$k] / $growth_c) * 100, 2); } ?>% | @foreach($categorys['name'] as $category){{number_format($category_money[$category['id']],2)}} | @endforeach
净值合计 | @if($select['query']['tag'] == 'customer_id') | @endif | 0) { $pre = number_format(($v2 / $last_year_sum) * 100, 2); } ?> {{$pre}}% | {{number_format($growth_a, 2)}} | {{number_format($total['all'], 2)}} | @foreach($categorys['name'] as $category) | {{number_format($total[$category['id']],2)}} | @endforeach|||||||
增长合计 | @if($select['query']['tag'] == 'customer_id') | @endif | 0) { $pre = number_format(($growth_b / $last_year_sum) * 100, 2); } ?> {{$pre}}% | {{number_format($growth_b, 2)}} | @foreach($categorys['name'] as $category) | @endforeach | ||||||||
下降合计 | @if($select['query']['tag'] == 'customer_id') | @endif | 0) { $pre = number_format(($growth_c / $last_year_sum) * 100, 2); } ?> {{$pre}}% | {{number_format($growth_c, 2)}} | @foreach($categorys['name'] as $category) | @endforeach |