|
@@ -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
|
}
|