sunhao лет назад: 5
Родитель
Сommit
720bad772b
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      app/Http/Controllers/Admin/StatisticsController.php

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

452
                 <th>".iconv("UTF-8", "GB2312//IGNORE","毛利")."</th>              
452
                 <th>".iconv("UTF-8", "GB2312//IGNORE","毛利")."</th>              
453
                 <th>".iconv("UTF-8", "GB2312//IGNORE","当日新粉成单率")."</th>              
453
                 <th>".iconv("UTF-8", "GB2312//IGNORE","当日新粉成单率")."</th>              
454
                 <th>".iconv("UTF-8", "GB2312//IGNORE","综合成单率")."</th>              
454
                 <th>".iconv("UTF-8", "GB2312//IGNORE","综合成单率")."</th>              
455
+                <th>".iconv("UTF-8", "GB2312//IGNORE","复购率")."</th>              
456
+                <th>".iconv("UTF-8", "GB2312//IGNORE","综合ROI")."</th>              
457
+                <th>".iconv("UTF-8", "GB2312//IGNORE","新粉ROI")."</th>              
455
 
458
 
456
             </tr>";
459
             </tr>";
457
 
460
 
505
                 $fugou_order_count_no = $order->order_count - $fugou->order_count;
508
                 $fugou_order_count_no = $order->order_count - $fugou->order_count;
506
                 $v['fugou_rate'] = $fugou_order_count_no>0 ? round($fugou->order_count / $fugou_order_count_no, 4) * 100 .'%' : '';
509
                 $v['fugou_rate'] = $fugou_order_count_no>0 ? round($fugou->order_count / $fugou_order_count_no, 4) * 100 .'%' : '';
507
 
510
 
511
+                //加roi
512
+                $v['total_roi'] = $v['total_cost']>0 ? round($v['order_amount'] / $v['total_cost'], 4) * 100 .'%' : '';
513
+                $v['new_roi'] = $v['total_cost']>0 ? round($v['new_order_amount'] / $v['total_cost'], 4) * 100 .'%' : '';   
514
+
508
                 $data_str .= "<tr>";
515
                 $data_str .= "<tr>";
509
                 $data_str .= "<td>".$v['dtime']."</td>";
516
                 $data_str .= "<td>".$v['dtime']."</td>";
510
                 $data_str .= "<td>".$v['total_fan_add']."</td>";
517
                 $data_str .= "<td>".$v['total_fan_add']."</td>";
521
                 $data_str .= "<td>".$v['profit']."</td>";
528
                 $data_str .= "<td>".$v['profit']."</td>";
522
                 $data_str .= "<td>".$v['new_order_rate']."</td>";
529
                 $data_str .= "<td>".$v['new_order_rate']."</td>";
523
                 $data_str .= "<td>".$v['order_rate']."</td>";
530
                 $data_str .= "<td>".$v['order_rate']."</td>";
531
+                $data_str .= "<td>".$v['fugou_rate']."</td>";
532
+                $data_str .= "<td>".$v['total_roi']."</td>";
533
+                $data_str .= "<td>".$v['new_roi']."</td>";
524
 
534
 
525
                 $data_str .= "</tr>";
535
                 $data_str .= "</tr>";
526
             }
536
             }