Ver Código Fonte

排序复购率

sunhao 5 anos atrás
pai
commit
55990857f5

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

@@ -4393,11 +4393,12 @@ class StatisticsController extends Controller
4393 4393
 
4394 4394
             $result[$k]['customer_count'] = $customer_count;
4395 4395
             $result[$k]['fugou_rate'] = $fugou_rate;
4396
+            $result[$k]['fugou_rate_sort'] = $customer_count>0 ? round( $customer_fugou_count / $customer_count, 4 ) * 10000 : 0;
4396 4397
 
4397 4398
         }
4398 4399
 
4399 4400
         //按复购率排序
4400
-        $fugou_rate_arr = array_column($result, 'fugou_rate');
4401
+        $fugou_rate_arr = array_column($result, 'fugou_rate_sort');
4401 4402
         array_multisort($fugou_rate_arr, SORT_DESC, $result);
4402 4403
         $result = array_slice($result, $offset, $pageSize);
4403 4404
 
@@ -4478,10 +4479,11 @@ class StatisticsController extends Controller
4478 4479
 
4479 4480
             $result[$k]['customer_count'] = $customer_count;
4480 4481
             $result[$k]['fugou_rate'] = $fugou_rate;
4482
+            $result[$k]['fugou_rate_sort'] = $customer_count>0 ? round( $customer_fugou_count / $customer_count, 4 ) * 10000 : 0;
4481 4483
         }
4482 4484
 
4483 4485
         //按复购率排序
4484
-        $fugou_rate_arr = array_column($result, 'fugou_rate');
4486
+        $fugou_rate_arr = array_column($result, 'fugou_rate_sort');
4485 4487
         array_multisort($fugou_rate_arr, SORT_DESC, $result);
4486 4488
 
4487 4489
         $indexKey = ['admin_name','pv_count','long_count','fan_add','change_rate','customer_count','order_count','order_amount','fugou_rate'];