sunhao %!s(int64=5) %!d(string=hace) años
padre
commit
2d0e3985fa

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

@@ -348,6 +348,10 @@ class StatisticsController extends Controller
348 348
             //复购率
349 349
             $fugou_order_count_no = $order->order_count - $fugou->order_count;
350 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,6 +43,8 @@
43 43
                     <th width="5%">当日新粉成单率</th>                                                 
44 44
                     <th width="5%">复购率</th>                                                 
45 45
                     <th width="5%">综合成单率</th>                                                 
46
+                    <th width="5%">综合roi</th>                                                 
47
+                    <th width="5%">新粉roi</th>                                                 
46 48
                 </tr>
47 49
                 </thead>
48 50
                 <tbody>
@@ -65,6 +67,8 @@
65 67
                             <td>{{$a['new_order_rate']}}</td>                                                       
66 68
                             <td>{{$a['fugou_rate']}}</td>                                                       
67 69
                             <td>{{$a['order_rate']}}</td>                                                       
70
+                            <td>{{$a['total_roi']}}</td>                                                       
71
+                            <td>{{$a['new_roi']}}</td>                                                       
68 72
                                                                                          
69 73
                         </tr>
70 74
                     @endforeach