sunhao 5 years ago
parent
commit
10bd5c0795

+ 12 - 2
app/Http/Controllers/Admin/StatisticsController.php

@@ -4394,11 +4394,16 @@ class StatisticsController extends Controller
4394 4394
             $no_fugou_count = $order->order_count - $fugou_count;
4395 4395
             //复购率
4396 4396
             $fugou_rate = $no_fugou_count>0 ? round( $fugou_count / $no_fugou_count, 4 ) * 100 . '%' : '';
4397
+            $cust_fugou_rate = $customer_count>0 ? round( $customer_fugou_count / $customer_count, 4 ) * 100 . '%' : '';
4397 4398
 
4398 4399
             $result[$k]['customer_count'] = $customer_count;
4399 4400
             $result[$k]['customer_fugou_count'] = $customer_fugou_count;
4400 4401
             $result[$k]['fugou_rate'] = $fugou_rate;
4402
+            $result[$k]['fugou_count'] = $fugou_count;
4403
+            $result[$k]['cust_fugou_rate'] = $cust_fugou_rate;
4401 4404
             $result[$k]['fugou_rate_sort'] = $no_fugou_count>0 ? round( $fugou_count / $no_fugou_count, 4 ) * 10000 : 0;
4405
+            //用户转化率
4406
+            $result[$k]['cust_order_rate'] = $result[$k]['fan_add']>0 ? round( $customer_count / $result[$k]['fan_add'], 4 ) * 100 . '%' : '';
4402 4407
 
4403 4408
         }
4404 4409
 
@@ -4484,11 +4489,16 @@ class StatisticsController extends Controller
4484 4489
             $no_fugou_count = $order->order_count - $fugou_count;
4485 4490
             //复购率
4486 4491
             $fugou_rate = $no_fugou_count>0 ? round( $fugou_count / $no_fugou_count, 4 ) * 100 . '%' : '';
4492
+            $cust_fugou_rate = $customer_count>0 ? round( $customer_fugou_count / $customer_count, 4 ) * 100 . '%' : '';
4487 4493
 
4488 4494
             $result[$k]['customer_count'] = $customer_count;
4489 4495
             $result[$k]['customer_fugou_count'] = $customer_fugou_count;
4490 4496
             $result[$k]['fugou_rate'] = $fugou_rate;
4497
+            $result[$k]['cust_fugou_rate'] = $cust_fugou_rate;
4498
+            $result[$k]['fugou_count'] = $fugou_count;
4491 4499
             $result[$k]['fugou_rate_sort'] = $no_fugou_count>0 ? round( $fugou_count / $no_fugou_count, 4 ) * 10000 : 0;
4500
+            //用户转化率
4501
+            $result[$k]['cust_order_rate'] = $result[$k]['fan_add']>0 ? round( $customer_count / $result[$k]['fan_add'], 4 ) * 100 . '%' : '';
4492 4502
         }
4493 4503
 
4494 4504
         //按复购率排序
@@ -4496,9 +4506,9 @@ class StatisticsController extends Controller
4496 4506
         array_multisort($fugou_rate_arr, SORT_DESC, $result);
4497 4507
 
4498 4508
         //$indexKey = ['admin_name','pv_count','long_count','fan_add','change_rate','customer_count','customer_fugou_count','order_count','order_amount','fugou_rate'];
4499
-        $indexKey = ['admin_name','customer_count','customer_fugou_count','order_count','order_amount','fugou_rate'];
4509
+        $indexKey = ['admin_name','fan_add','customer_count','cust_order_rate','order_count','order_amount', 'fugou_count', 'fugou_rate', 'customer_fugou_count', 'cust_fugou_rate'];
4500 4510
         //$title = ['销售', 'PV量', '累计预估加粉数', '累计加粉数', '加粉转化率', '下单用户数', '复购用户数', '累计下单数', '累计销售额', '复购率'];
4501
-        $title = ['销售', '下单用户数', '复购用户数', '累计下单数', '累计销售额', '复购率'];
4511
+        $title = ['销售', '累计加粉数', '下单用户数', '用户转化率', '累计下单数', '累计销售额', '复购订单数', '订单复购率', '复购用户数', '用户复购率'];
4502 4512
         $filename = 'xiaoshoufugou_'.date('Y-m-d_H').'.xlsx';
4503 4513
         return Order::export_excel($result, $filename, $indexKey, $title);  
4504 4514
     }

+ 15 - 8
resources/views/statistics/salerOrderFugou.blade.php

@@ -24,21 +24,24 @@
24 24
                 
25 25
             </div>
26 26
         </div>
27
-        
27
+      
28 28
         <div class="mt-20">
29 29
             <table class="table table-border table-bordered table-bg table-hover table-sort">
30 30
                 <thead>
31 31
                 <tr class="text-c">
32 32
                     <th width="5%">销售</th>
33 33
                     <!--th width="5%">PV量</th>
34
-                    <th width="5%">累计预估加粉数</th>
35
-                    <th width="5%">累计加粉数</th>
34
+                    <th width="5%">累计预估加粉数</th>                   
36 35
                     <th width="5%">加粉转化率</th-->
36
+                    <th width="5%">累计加粉数</th>
37 37
                     <th width="5%">下单用户数</th>
38
-                    <th width="5%">复购用户数</th>
38
+                    <th width="5%">用户转化率</th>                  
39 39
                     <th width="5%">累计下单数</th>
40 40
                     <th width="5%">累计销售额</th>                                                
41
-                    <th width="5%">复购率</th>                                                
41
+                    <th width="5%">复购订单数</th>                                                
42
+                    <th width="5%">订单复购率</th>  
43
+                    <th width="5%">复购用户数</th>                                              
44
+                    <th width="5%">用户复购率</th>                                                
42 45
                                               
43 46
                 </tr>
44 47
                 </thead>
@@ -50,12 +53,16 @@
50 53
                             <!--td>{{$a['pv_count']}}</td>                                                                                   
51 54
                             <td>{{$a['long_count']}}</td>                                                                                   
52 55
                             <td>{{$a['fan_add']}}</td>                          
53
-                            <td>{{$a['change_rate']}}</td-->                                                                                   
56
+                            <td>{{$a['change_rate']}}</td-->  
57
+                            <td>{{$a['fan_add']}}</td>                                                                                  
54 58
                             <td>{{$a['customer_count']}}</td>                                                                                   
55
-                            <td>{{$a['customer_fugou_count']}}</td>                                                                                   
59
+                            <td>{{$a['cust_order_rate']}}</td>                                                                                                                                                                                                 
56 60
                             <td>{{$a['order_count']}}</td>                                                                                   
57 61
                             <td>{{$a['order_amount']}}</td>                                                                                   
58
-                            <td>{{$a['fugou_rate']}}</td>                                                                                   
62
+                            <td>{{$a['fugou_count']}}</td>                                                                                   
63
+                            <td>{{$a['fugou_rate']}}</td>  
64
+                            <td>{{$a['customer_fugou_count']}}</td>                                                                                 
65
+                            <td>{{$a['cust_fugou_rate']}}</td>                                                                                   
59 66
                            
60 67
                         </tr>
61 68
                     @endforeach