sunhao 5 years ago
parent
commit
2d0e3985fa

+ 4 - 0
app/Http/Controllers/Admin/StatisticsController.php

348
             //复购率
348
             //复购率
349
             $fugou_order_count_no = $order->order_count - $fugou->order_count;
349
             $fugou_order_count_no = $order->order_count - $fugou->order_count;
350
             $v['fugou_rate'] = $fugou_order_count_no>0 ? round($fugou->order_count / $fugou_order_count_no, 4) * 100 .'%' : '';
350
             $v['fugou_rate'] = $fugou_order_count_no>0 ? round($fugou->order_count / $fugou_order_count_no, 4) * 100 .'%' : '';
351
+
352
+            //加roi
353
+            $v['total_roi'] = $v['total_cost']>0 ? round($v['order_amount'] / $v['total_cost'], 4) * 100 .'%' : '';
354
+            $v['new_roi'] = $v['total_cost']>0 ? round($v['new_order_amount'] / $v['total_cost'], 4) * 100 .'%' : '';
351
             
355
             
352
         }
356
         }
353
 
357
 

+ 4 - 0
resources/views/statistics/orderDay.blade.php

43
                     <th width="5%">当日新粉成单率</th>                                                 
43
                     <th width="5%">当日新粉成单率</th>                                                 
44
                     <th width="5%">复购率</th>                                                 
44
                     <th width="5%">复购率</th>                                                 
45
                     <th width="5%">综合成单率</th>                                                 
45
                     <th width="5%">综合成单率</th>                                                 
46
+                    <th width="5%">综合roi</th>                                                 
47
+                    <th width="5%">新粉roi</th>                                                 
46
                 </tr>
48
                 </tr>
47
                 </thead>
49
                 </thead>
48
                 <tbody>
50
                 <tbody>
65
                             <td>{{$a['new_order_rate']}}</td>                                                       
67
                             <td>{{$a['new_order_rate']}}</td>                                                       
66
                             <td>{{$a['fugou_rate']}}</td>                                                       
68
                             <td>{{$a['fugou_rate']}}</td>                                                       
67
                             <td>{{$a['order_rate']}}</td>                                                       
69
                             <td>{{$a['order_rate']}}</td>                                                       
70
+                            <td>{{$a['total_roi']}}</td>                                                       
71
+                            <td>{{$a['new_roi']}}</td>                                                       
68
                                                                                          
72
                                                                                          
69
                         </tr>
73
                         </tr>
70
                     @endforeach
74
                     @endforeach