|
@@ -646,7 +646,7 @@ class TemplateController extends Controller
|
646
|
646
|
if($mstime) $query->where('create_time', '>=', $mstime);
|
647
|
647
|
if($metime) $query->where('create_time', '<', $metime);
|
648
|
648
|
if($sale_ids !== null) $query->whereIn('admin_id', $sale_ids);
|
649
|
|
- })->groupBy('month')->groupBy('admin_id')->orderBy('month', 'desc')->offset($offset)->limit($pageSize)->get();
|
|
649
|
+ })->groupBy('month')->groupBy('admin_id')->orderBy('month', 'desc')->get();
|
650
|
650
|
$result = json_decode(json_encode($result), true);
|
651
|
651
|
foreach($result as $k=>&$v){
|
652
|
652
|
//起止时间
|
|
@@ -691,6 +691,10 @@ class TemplateController extends Controller
|
691
|
691
|
|
692
|
692
|
}
|
693
|
693
|
|
|
694
|
+ $sort_c = array_column($result, 'avg_amount');
|
|
695
|
+ array_multisort($sort_c,SORT_DESC,$result);
|
|
696
|
+ $result = array_slice($result, $offset, $pageSize);
|
|
697
|
+
|
694
|
698
|
$teamList = DB::table('teams')->select('id', 'name')->get();
|
695
|
699
|
$teamList = json_decode(json_encode($teamList), true);
|
696
|
700
|
$adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
|
|
@@ -780,6 +784,9 @@ class TemplateController extends Controller
|
780
|
784
|
|
781
|
785
|
}
|
782
|
786
|
|
|
787
|
+ $sort_c = array_column($result, 'avg_amount');
|
|
788
|
+ array_multisort($sort_c,SORT_DESC,$result);
|
|
789
|
+
|
783
|
790
|
$indexKey = ['month','admin_name','pv_count','long_count','fan_add','cust_count','order_count','fugou_order_count','order_amount','change_rate','new_order_rate','cust_fugou_rate','order_fugou_rate','avg_amount'];
|
784
|
791
|
$title = ['月份', '销售名', '当月PV量', '当月长按次数', '当月上报加粉数', '当月新粉下单人数', '新粉下单单数', '当月粉丝复购单数', '当月粉丝总销售额', '粉丝转化率', '新粉下单率', '新粉复购率', '新粉订单复购率', '当月粉丝人均销售额'];
|
785
|
792
|
$filename = 'daofenyuebao_'.date('Y-m-d_H').'.xlsx';
|