|
@@ -362,6 +362,10 @@ class custReportController extends Controller
|
362
|
362
|
$adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
|
363
|
363
|
$adminList = json_decode(json_encode($adminList), true);
|
364
|
364
|
|
|
365
|
+ //未上报数据销售
|
|
366
|
+ $noReportSaler = $this->noReportSaler();
|
|
367
|
+ $no_height = '100';
|
|
368
|
+ if($no_num = count($noReportSaler)) $no_height += round($no_num * 36);
|
365
|
369
|
return view('custreport/detaillist', ['result' =>$result,
|
366
|
370
|
'page' =>$page,
|
367
|
371
|
'count' =>$count,
|
|
@@ -371,6 +375,8 @@ class custReportController extends Controller
|
371
|
375
|
'admin_id' =>$admin_id,
|
372
|
376
|
'search_admin' =>$search_admin,
|
373
|
377
|
'adminlist' =>$adminList,
|
|
378
|
+ 'noReportSaler' =>$noReportSaler,
|
|
379
|
+ 'no_height' =>$no_height,
|
374
|
380
|
]);
|
375
|
381
|
}
|
376
|
382
|
|
|
@@ -734,5 +740,39 @@ class custReportController extends Controller
|
734
|
740
|
return redirect('admin/custreport/disCostList')->with('info','导入成功');
|
735
|
741
|
|
736
|
742
|
}
|
|
743
|
+
|
|
744
|
+ /**
|
|
745
|
+ * 未上报数据销售
|
|
746
|
+ */
|
|
747
|
+ public function noReportSaler(){
|
|
748
|
+ $today = date('Y-m-d');
|
|
749
|
+ //销售列表
|
|
750
|
+ $ids = DB::table('admin_role')->where('role_name', '销售')->lists('user_id');
|
|
751
|
+ //销售名字
|
|
752
|
+ $salers = DB::table('admin')->whereIn('id', $ids)->lists('realname', 'id');
|
|
753
|
+
|
|
754
|
+ //查每日上报数据销售
|
|
755
|
+ $result = DB::table('cust_day_detail')->select('admin_id', 'dtime')->where('dtime','<',$today)->where('is_del', 0)->orderBy('dtime', 'desc')->get();
|
|
756
|
+ $result = json_decode(json_encode($result), true);
|
|
757
|
+
|
|
758
|
+ $data = array();
|
|
759
|
+ foreach($result as $k=>$v){
|
|
760
|
+ $data[$v['dtime']][] = $v['admin_id'];
|
|
761
|
+ }
|
|
762
|
+
|
|
763
|
+ $ret = array();
|
|
764
|
+ foreach($data as $k=>$v){
|
|
765
|
+ $diff = array_diff($ids, $v);
|
|
766
|
+ if(!empty($diff)){
|
|
767
|
+ //名字带入
|
|
768
|
+ foreach($diff as &$nid){
|
|
769
|
+ $nid = $salers[$nid];
|
|
770
|
+ }
|
|
771
|
+ $ret[$k] = implode(',', $diff);
|
|
772
|
+ }
|
|
773
|
+ }
|
|
774
|
+
|
|
775
|
+ return $ret;
|
|
776
|
+ }
|
737
|
777
|
}
|
738
|
778
|
|