sunhao 5 年之前
父節點
當前提交
e731429d41
共有 2 個文件被更改,包括 83 次插入0 次删除
  1. 40 0
      app/Http/Controllers/Admin/CustReportController.php
  2. 43 0
      resources/views/custreport/detaillist.blade.php

+ 40 - 0
app/Http/Controllers/Admin/CustReportController.php

362
         $adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
362
         $adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
363
         $adminList = json_decode(json_encode($adminList), true);
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
         return view('custreport/detaillist', ['result' =>$result,
369
         return view('custreport/detaillist', ['result' =>$result,
366
             'page'              =>$page,
370
             'page'              =>$page,
367
             'count'             =>$count,
371
             'count'             =>$count,
371
             'admin_id'          =>$admin_id,
375
             'admin_id'          =>$admin_id,
372
             'search_admin'      =>$search_admin,
376
             'search_admin'      =>$search_admin,
373
             'adminlist'         =>$adminList,
377
             'adminlist'         =>$adminList,
378
+            'noReportSaler'         =>$noReportSaler,
379
+            'no_height'         =>$no_height,
374
             ]);
380
             ]);
375
     }
381
     }
376
 
382
 
734
         return redirect('admin/custreport/disCostList')->with('info','导入成功');       
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
 

+ 43 - 0
resources/views/custreport/detaillist.blade.php

21
                
21
                
22
                 
22
                 
23
                     <a style="margin-left: 5px" class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
23
                     <a style="margin-left: 5px" class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
24
+                    <a style="margin-left: 5px" class="btn btn-primary radius" onclick="look_noreport()" href="javascript:;">查看未上报数据销售</a>
24
                     <!--a class="btn btn-primary radius" onclick="custreport_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出订单</a-->
25
                     <!--a class="btn btn-primary radius" onclick="custreport_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出订单</a-->
25
                 
26
                 
26
             </div>
27
             </div>
59
                 </tbody>
60
                 </tbody>
60
             </table>
61
             </table>
61
         </div>
62
         </div>
63
+        <!--弹出层 推入分组-->
64
+        <div id="modal-demo1" class="modal fade" tabnonautomatic_index="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
65
+            <div class="modal-dialog" style="width:980px">
66
+                <div class="modal-content radius" style="width:980px">
67
+                    <div class="modal-body" style="height:{{$no_height}}px">
68
+                        <div id="fa2">                       
69
+                            <div class="mt-20">
70
+                                <table class="table table-border table-bordered table-bg table-hover table-sort">
71
+                                    <thead>
72
+                                    <tr class="text-c">
73
+                                        <th>日期</th>
74
+                                        <th>未上报销售</th>
75
+                                            
76
+                                    </tr>
77
+                                    </thead>
78
+                                    <tbody>
79
+                                    @if($noReportSaler)
80
+                                        @foreach($noReportSaler as $date=>$saler)
81
+                                            <tr class="text-c" style=" text-align:center;">                           
82
+                                                <td>{{$date}}</td>                            
83
+                                                <td>{{$saler}}</td>                                                                             
84
+                                            </tr>
85
+                                        @endforeach
86
+                                    @endif
87
+                                    </tbody>
88
+                                </table>
89
+                            </div>
90
+                           
91
+                        </div>
92
+         
93
+                        <div style="float:right">                           
94
+                            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">关闭</button>
95
+                        </div>
96
+                    </div>
97
+                </div>
98
+            </div>
99
+        </div>
62
         <div id="page" class="page_div"></div>
100
         <div id="page" class="page_div"></div>
63
     </div>
101
     </div>
64
     
102
     
112
             var etime = $('#etime').val();
150
             var etime = $('#etime').val();
113
             location.href = '/admin/custreport/detail_export?admin_id='+admin_id+'&stime='+stime+'&etime='+etime;
151
             location.href = '/admin/custreport/detail_export?admin_id='+admin_id+'&stime='+stime+'&etime='+etime;
114
         }
152
         }
153
+
154
+        /*弹出层-填写原因*/
155
+        function look_noreport() {
156
+            $("#modal-demo1").modal("show");
157
+        }
115
        
158
        
116
         /*分页*/
159
         /*分页*/
117
         
160