Browse Source

报表统计,导出

sunhao 5 years ago
parent
commit
d1d52e401a

+ 34 - 6
app/Http/Controllers/Admin/CustReportController.php

@@ -24,11 +24,12 @@ class custReportController extends Controller
24 24
         }
25 25
 
26 26
         $offset = ($page-1) * $pageSize;
27
-        
27
+        $team_id = (int)$request->input('team_id');
28 28
         $stime = $request->input('stime');
29 29
         $etime = $request->input('etime');
30 30
 
31
-        $count = CustTotal::where(function($query) use($stime, $etime){
31
+        $count = CustTotal::where(function($query) use($team_id, $stime, $etime){
32
+            if($team_id) $query->where('team_id', $team_id);
32 33
             if($stime) $query->where('dtime', '>=', $stime);
33 34
             if($etime) $query->where('dtime', '<=', $etime);
34 35
         })->where('is_del',0)->count();
@@ -40,18 +41,32 @@ class custReportController extends Controller
40 41
             $pages = 1;
41 42
         }
42 43
 
43
-        $result = CustTotal::where(function($query) use($stime, $etime){
44
+        $result = CustTotal::where(function($query) use($team_id, $stime, $etime){
45
+            if($team_id) $query->where('team_id', $team_id);
44 46
             if($stime) $query->where('dtime', '>=', $stime);
45 47
             if($etime) $query->where('dtime', '<=', $etime);
46 48
         })->where('is_del',0)->orderBy('id', 'desc')->offset($offset)->limit($pageSize)->get();
47 49
         $result = json_decode(json_encode($result),true);
48 50
 
51
+        foreach($result as $k=>&$v){
52
+            if($v['team_id']>0){
53
+                $team = DB::table('teams')->select('name')->where('id', $v['team_id'])->first();
54
+                $v['team_name'] = isset($team->name) ? $team->name : '';
55
+            }else{
56
+                $v['team_name'] = '';
57
+            }
58
+        }
59
+
60
+        $teamList = DB::table('teams')->select('id', 'name')->get();
61
+        $teamList = json_decode(json_encode($teamList), true);
49 62
         return view('custreport/totallist', ['result' =>$result,
50 63
             'page'              =>$page,
51 64
             'count'             =>$count,
52 65
             'pages'             =>$pages,          
66
+            'teamlist'          =>$teamList,          
53 67
             'stime'             =>$stime,
54 68
             'etime'             =>$etime,
69
+            'team_id'           =>$team_id,
55 70
             ]);
56 71
     }
57 72
 
@@ -61,7 +76,9 @@ class custReportController extends Controller
61 76
      */
62 77
     public function totalcreate(Request $request)
63 78
     {
64
-        return view('custreport/totalcreate');
79
+        $teamList = DB::table('teams')->select('id', 'name')->get();
80
+        $teamList = json_decode(json_encode($teamList), true);
81
+        return view('custreport/totalcreate',['teamlist'=>$teamList]);
65 82
     }
66 83
     /**
67 84
      * 分组管理-进行添加操作
@@ -70,14 +87,17 @@ class custReportController extends Controller
70 87
      */
71 88
     public function totalstore(Request $request)
72 89
     {       
90
+        $team_id = (int)$request->input('team_id');
73 91
         $this->validate($request, [
74 92
             'total_cost'           => 'required', 
75 93
             'total_fan_add'           => 'required',   
76
-            'dtime'           => 'required|unique:cust_day_total,dtime,1,is_del',   
94
+            'team_id'           => 'required',   
95
+            'dtime'           => 'required|unique:cust_day_total,dtime,1,is_del,team_id,'.$team_id,   
77 96
         ], [                  
78 97
             'total_cost.required'           => '总成本不能为空',                   
79 98
             'total_fan_add.required'           => '总加粉数不能为空',                                    
80 99
             'dtime.required'           => '日期不能为空',
100
+            'team_id.required'           => '团队不能为空',
81 101
             'dtime.unique'           => '指定日期已经添加过',                                    
82 102
         ]);
83 103
         //数据库-新增数据
@@ -86,6 +106,7 @@ class custReportController extends Controller
86 106
         $custreport['total_cost'] = $request->input('total_cost'); 
87 107
         $custreport['total_fan_add'] = $request->input('total_fan_add'); 
88 108
         $custreport['dtime'] = $request->input('dtime'); 
109
+        $custreport['team_id'] = $team_id; 
89 110
                 
90 111
         $res = DB::table('cust_day_total')->insert($custreport);            
91 112
         return redirect('/admin/custreport/totalindex')->with('info', '添加成功'); 
@@ -101,8 +122,11 @@ class custReportController extends Controller
101 122
     {
102 123
         
103 124
         $data = CustTotal::where('id', $id)->first();
125
+        $teamList = DB::table('teams')->select('id', 'name')->get();
126
+        $teamList = json_decode(json_encode($teamList), true);
104 127
         return view('custreport/totaledit', [       
105 128
             'custreport' => $data,
129
+            'teamlist' => $teamList,
106 130
         ]);
107 131
 
108 132
     }
@@ -114,16 +138,19 @@ class custReportController extends Controller
114 138
      */
115 139
     public function totalupdate(Request $request)
116 140
     {    
141
+        $team_id = (int)$request->input('team_id');
117 142
         $id = (int)$request->input('id');        
118 143
         $this->validate($request, [
119 144
             'id'                  => 'required',
120 145
             'total_cost'          => 'required', 
121 146
             'total_fan_add'       => 'required',   
122
-            'dtime'               => 'required|unique:cust_day_total,dtime,'.$id.',id,is_del,0',   
147
+            'team_id'             => 'required',   
148
+            'dtime'               => 'required|unique:cust_day_total,dtime,'.$id.',id,team_id,'.$team_id,   
123 149
         ], [                  
124 150
             'id.required'              => 'id不能为空',                   
125 151
             'total_cost.required'      => '总成本不能为空',                   
126 152
             'total_fan_add.required'   => '总加粉数不能为空',                                    
153
+            'team_id.required'           => '团队不能为空',
127 154
             'dtime.required'           => '日期不能为空',
128 155
             'dtime.unique'           => '指定日期已存在',                                    
129 156
         ]);
@@ -132,6 +159,7 @@ class custReportController extends Controller
132 159
         $custreport['total_cost'] = $request->input('total_cost'); 
133 160
         $custreport['total_fan_add'] = $request->input('total_fan_add'); 
134 161
         $custreport['dtime'] = $request->input('dtime'); 
162
+        $custreport['team_id'] = $team_id; 
135 163
 
136 164
         $res = DB::table('cust_day_total')->where('id', $id)->update($custreport);        
137 165
         return redirect('/admin/custreport/totalindex')->with('info', '更新成功');         

+ 359 - 0
app/Http/Controllers/Admin/StatisticsController.php

@@ -0,0 +1,359 @@
1
+<?php
2
+/**
3
+ * Created by Sublime.
4
+ * User: hao
5
+ * Date: 19/08/30
6
+ * Time: 上午11:20
7
+ */
8
+namespace App\Http\Controllers\Admin;
9
+
10
+use App\Http\Controllers\Controller;
11
+use App\Logs;
12
+use App\CustTotal;
13
+use App\CustDetail;
14
+use Illuminate\Http\Request;
15
+use Illuminate\Support\Facades\DB;
16
+
17
+class StatisticsController extends Controller
18
+{
19
+    /**
20
+     * 当日数据统计
21
+     */
22
+	public function fanDay(Request $request){
23
+        $page = (int)$request->input('page');
24
+        $pageSize = 20;
25
+        if($page<=0){
26
+            $page = 1;
27
+        }
28
+
29
+        $offset = ($page-1) * $pageSize;
30
+        
31
+        $stime = $request->input('stime');
32
+        $etime = $request->input('etime');
33
+
34
+        $count = CustTotal::select(DB::raw('count(distinct dtime) as total'))->where(function($query) use($stime, $etime){
35
+            if($stime) $query->where('dtime', '>=', $stime);
36
+            if($etime) $query->where('dtime', '<=', $etime);
37
+        })->where('is_del',0)->first();
38
+        $count = $count->total;
39
+        if ($count > 1) {
40
+            // 总页数
41
+            $pages = ceil($count/$pageSize);
42
+        }else{
43
+            // 总页数
44
+            $pages = 1;
45
+        }
46
+
47
+        $result = CustTotal::select(DB::raw('sum(total_cost) as total_cost, sum(total_fan_add) as total_fan_add, dtime'))->where(function($query) use($stime, $etime){
48
+            if($stime) $query->where('dtime', '>=', $stime);
49
+            if($etime) $query->where('dtime', '<=', $etime);
50
+        })->where('is_del',0)->groupBy('dtime')->orderBy('dtime', 'desc')->offset($offset)->limit($pageSize)->get();
51
+        $result = json_decode(json_encode($result),true);
52
+        foreach($result as $k=>&$v){
53
+            #进粉成本
54
+            $v['cost_fan'] = $v['total_fan_add']>0? round($v['total_cost'] / $v['total_fan_add'], 2) : '';
55
+            #当日微信粉
56
+            $custDetail = CustDetail::select(DB::raw('sum(fan_add) as wx_fan_add, sum(new_reply) as total_new_reply, sum(old_consult) as total_old_consult'))->where('dtime', $v['dtime'])->where('is_del', 0)->first();
57
+            $v['wx_fan_add'] = $custDetail->wx_fan_add; //当日微信粉数
58
+            $v['total_new_reply'] = $custDetail->total_new_reply; //当日微信新粉回复
59
+            $v['total_old_consult'] = $custDetail->total_old_consult; //当日微信老粉询价
60
+            $v['new_reply_rate'] = $v['wx_fan_add']>0? round($v['total_new_reply'] / $v['wx_fan_add'], 2) * 100 .'%' : ''; //当日新粉回复率
61
+
62
+            #当日微信粉成本
63
+            $v['cost_wx_fan'] = $v['wx_fan_add']>0?  round($v['total_cost'] / $v['wx_fan_add'], 2) : '';
64
+            #当日订单数、销售额
65
+            $order = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count'))->where('createTime','>=', $v['dtime'])->where('createTime','<', $v['dtime'].' 23:59:59')->where('is_del', 0)->first();
66
+            $v['order_count'] = $order->order_count;
67
+            $v['order_amount'] = $order->order_amount;
68
+            
69
+        }
70
+
71
+        return view('statistics/fanDay', ['result' =>$result,
72
+            'page'              =>$page,
73
+            'count'             =>$count,
74
+            'pages'             =>$pages,          
75
+            'stime'             =>$stime,
76
+            'etime'             =>$etime,
77
+            ]);
78
+    }
79
+
80
+    public function fanDay_export(Request $request){
81
+        
82
+        $stime = $request->input('stime');
83
+        $etime = $request->input('etime');
84
+
85
+        $result = CustTotal::select(DB::raw('sum(total_cost) as total_cost, sum(total_fan_add) as total_fan_add, dtime'))->where(function($query) use($stime, $etime){
86
+            if($stime) $query->where('dtime', '>=', $stime);
87
+            if($etime) $query->where('dtime', '<=', $etime);
88
+        })->where('is_del',0)->groupBy('dtime')->orderBy('dtime', 'desc')->get();
89
+        $result = json_decode(json_encode($result),true);
90
+
91
+        $filename="当日数据统计.xls";
92
+        header("Content-type:application/vnd.ms-excel");
93
+        Header("Accept-Ranges:bytes");
94
+        Header("Content-Disposition:attachment;filename=".$filename); //$filename导出的文件名
95
+        header("Pragma: no-cache");
96
+        header("Expires: 0");
97
+        $data_str = '<html xmlns:o="urn:schemas-microsoft-com:office:office"
98
+            xmlns:x="urn:schemas-microsoft-com:office:excel"
99
+            xmlns="http://www.w3.org/TR/REC-html40">
100
+            <head>
101
+            <meta http-equiv="expires" content="Mon, 06 Jan 1999 00:00:01 GMT">
102
+            <meta http-equiv=Content-Type content="text/html; charset=gb2312">
103
+            <!--[if gte mso 9]><xml>
104
+            <x:ExcelWorkbook>
105
+            <x:ExcelWorksheets>
106
+            <x:ExcelWorksheet>
107
+            <x:Name></x:Name>
108
+            <x:WorksheetOptions>
109
+            <x:DisplayGridlines/>
110
+            </x:WorksheetOptions>
111
+            </x:ExcelWorksheet>
112
+            </x:ExcelWorksheets>
113
+            </x:ExcelWorkbook>
114
+            </xml><![endif]-->
115
+            </head>';
116
+        $data_str .= "
117
+            <table>
118
+            <tr>
119
+                <th>".iconv("UTF-8", "GB2312//IGNORE","日期")."</th>
120
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日投放金额")."</th>
121
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日公众号进粉")."</th>
122
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日进粉成本")."</th>
123
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日微信粉")."</th>
124
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日微信粉成本")."</th>
125
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日订单数")."</th>
126
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日销售额")."</th>
127
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日新粉回复量")."</th>
128
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日新粉回复率")."</th>
129
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日老粉主动咨询量")."</th>              
130
+
131
+            </tr>";
132
+            foreach ($result as $k => $v)
133
+            {
134
+                #进粉成本
135
+                $v['cost_fan'] = $v['total_fan_add']>0 ? round($v['total_cost'] / $v['total_fan_add'], 2) : '';
136
+                #当日微信粉
137
+                $custDetail = CustDetail::select(DB::raw('sum(fan_add) as wx_fan_add, sum(new_reply) as total_new_reply, sum(old_consult) as total_old_consult'))->where('dtime', $v['dtime'])->where('is_del', 0)->first();
138
+                $v['wx_fan_add'] = $custDetail->wx_fan_add; //当日微信粉数
139
+                $v['total_new_reply'] = $custDetail->total_new_reply; //当日微信新粉回复
140
+                $v['total_old_consult'] = $custDetail->total_old_consult; //当日微信老粉询价
141
+                $v['new_reply_rate'] = $v['wx_fan_add']>0 ? round($v['total_new_reply'] / $v['wx_fan_add'], 2) * 100 .'%' : ''; //当日新粉回复率
142
+
143
+                #当日微信粉成本
144
+                $v['cost_wx_fan'] = $v['wx_fan_add']>0 ? round($v['total_cost'] / $v['wx_fan_add'], 2) : '';
145
+                #当日订单数、销售额
146
+                $order = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count'))->where('createTime','>=', $v['dtime'])->where('createTime','<', $v['dtime'].' 23:59:59')->where('is_del', 0)->first();
147
+                $v['order_count'] = $order->order_count;
148
+                $v['order_amount'] = $order->order_amount;
149
+
150
+                $data_str .= "<tr>";
151
+                $data_str .= "<td>".$v['dtime']."</td>";
152
+                $data_str .= "<td>".$v['total_cost']."</td>";
153
+                $data_str .= "<td>".$v['total_fan_add']."</td>";
154
+                $data_str .= "<td>".$v['cost_fan']."</td>";
155
+                $data_str .= "<td>".$v['wx_fan_add']."</td>";
156
+                $data_str .= "<td>".$v['cost_wx_fan']."</td>";
157
+                $data_str .= "<td>".$v['order_count']."</td>";
158
+                $data_str .= "<td>".$v['order_amount']."</td>";
159
+                $data_str .= "<td>".$v['total_new_reply']."</td>";
160
+                $data_str .= "<td>".$v['new_reply_rate']."</td>";
161
+                $data_str .= "<td>".$v['total_old_consult']."</td>";
162
+
163
+                $data_str .= "</tr>";
164
+            }
165
+
166
+        $data_str .= "</table>";
167
+        echo $data_str;
168
+        exit;       
169
+    }
170
+
171
+    /**
172
+     * 当日数据统计
173
+     */
174
+    public function orderDay(Request $request){
175
+        $page = (int)$request->input('page');
176
+        $pageSize = 20;
177
+        if($page<=0){
178
+            $page = 1;
179
+        }
180
+
181
+        $offset = ($page-1) * $pageSize;
182
+        
183
+        $stime = $request->input('stime');
184
+        $etime = $request->input('etime');
185
+
186
+        $count = CustTotal::where(function($query) use($stime, $etime){
187
+            if($stime) $query->where('dtime', '>=', $stime);
188
+            if($etime) $query->where('dtime', '<=', $etime);
189
+        })->where('is_del',0)->count();
190
+        if ($count > 1) {
191
+            // 总页数
192
+            $pages = ceil($count/$pageSize);
193
+        }else{
194
+            // 总页数
195
+            $pages = 1;
196
+        }
197
+
198
+        $result = CustTotal::select(DB::raw('sum(total_cost) as total_cost, sum(total_fan_add) as total_fan_add, dtime'))->where(function($query) use($stime, $etime){
199
+            if($stime) $query->where('dtime', '>=', $stime);
200
+            if($etime) $query->where('dtime', '<=', $etime);
201
+        })->where('is_del',0)->groupBy('dtime')->orderBy('dtime', 'desc')->offset($offset)->limit($pageSize)->get();
202
+        $result = json_decode(json_encode($result),true);
203
+        foreach($result as $k=>&$v){
204
+            #当日微信好友数量
205
+            $custDetail = CustDetail::select(DB::raw('sum(fan_add) as wx_fan_add'))->where('dtime', $v['dtime'])->where('is_del', 0)->first();
206
+            $v['wx_fan_add'] = $custDetail->wx_fan_add; //当日微信粉数
207
+            
208
+            #当日订单总计:
209
+            $order = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count, sum(cost) as order_cost'))->where('createTime','>=', $v['dtime'])->where('createTime','<', $v['dtime'].' 23:59:59')->where('is_del', 0)->first();
210
+            #当日新粉成单:
211
+            $phones = DB::table('customers')->where('fanTime', $v['dtime'])->lists('phone');
212
+            $new_order = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count'))->where('createTime','>=', $v['dtime'])->where('createTime','<', $v['dtime'].' 23:59:59')->where('is_del', 0)->whereIn('receiverMobile', $phones)->first();
213
+            // 1.当日新粉成单数
214
+            $v['new_order_count'] = $new_order->order_count;
215
+            // 2.当日新粉成交额 
216
+            $v['new_order_amount'] = $new_order->order_amount;
217
+            // 3.老粉成单数
218
+            $v['old_order_count'] = $order->order_count - $new_order->order_count;
219
+            // 4.老粉成交额
220
+            $v['old_order_amount'] = $order->order_amount - $new_order->order_amount;
221
+            // 5.总成交额
222
+            $v['order_amount'] = $order->order_amount;
223
+
224
+            #复购单数、复购成交额
225
+            $fugou = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count'))->where('createTime','>=', $v['dtime'])->where('createTime','<', $v['dtime'].' 23:59:59')->where('is_del', 0)->where('is_fugou', 1)->first();
226
+            $v['fugou_order_count'] = $fugou->order_count;
227
+            $v['fugou_order_amount'] = $fugou->order_amount;
228
+            #货品成本
229
+            $v['order_cost'] = $order->order_cost;
230
+            #毛利
231
+            $v['profit'] = $v['order_amount'] - $v['order_cost'] - $v['total_cost'];
232
+            //综合成单率
233
+            $v['order_rate'] = '';
234
+            
235
+        }
236
+
237
+        return view('statistics/orderDay', ['result' =>$result,
238
+            'page'              =>$page,
239
+            'count'             =>$count,
240
+            'pages'             =>$pages,          
241
+            'stime'             =>$stime,
242
+            'etime'             =>$etime,
243
+            ]);
244
+    }
245
+
246
+    public function orderDay_export(Request $request){
247
+        
248
+        $stime = $request->input('stime');
249
+        $etime = $request->input('etime');
250
+
251
+        $result = CustTotal::select(DB::raw('sum(total_cost) as total_cost, sum(total_fan_add) as total_fan_add, dtime'))->where(function($query) use($stime, $etime){
252
+            if($stime) $query->where('dtime', '>=', $stime);
253
+            if($etime) $query->where('dtime', '<=', $etime);
254
+        })->where('is_del',0)->groupBy('dtime')->orderBy('dtime', 'desc')->get();
255
+        $result = json_decode(json_encode($result),true);
256
+
257
+        $filename="分片数据统计.xls";
258
+        header("Content-type:application/vnd.ms-excel");
259
+        Header("Accept-Ranges:bytes");
260
+        Header("Content-Disposition:attachment;filename=".$filename); //$filename导出的文件名
261
+        header("Pragma: no-cache");
262
+        header("Expires: 0");
263
+        $data_str = '<html xmlns:o="urn:schemas-microsoft-com:office:office"
264
+            xmlns:x="urn:schemas-microsoft-com:office:excel"
265
+            xmlns="http://www.w3.org/TR/REC-html40">
266
+            <head>
267
+            <meta http-equiv="expires" content="Mon, 06 Jan 1999 00:00:01 GMT">
268
+            <meta http-equiv=Content-Type content="text/html; charset=gb2312">
269
+            <!--[if gte mso 9]><xml>
270
+            <x:ExcelWorkbook>
271
+            <x:ExcelWorksheets>
272
+            <x:ExcelWorksheet>
273
+            <x:Name></x:Name>
274
+            <x:WorksheetOptions>
275
+            <x:DisplayGridlines/>
276
+            </x:WorksheetOptions>
277
+            </x:ExcelWorksheet>
278
+            </x:ExcelWorksheets>
279
+            </x:ExcelWorkbook>
280
+            </xml><![endif]-->
281
+            </head>';
282
+        $data_str .= "
283
+            <table>
284
+            <tr>
285
+                <th>".iconv("UTF-8", "GB2312//IGNORE","日期")."</th>
286
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日进粉数量")."</th>
287
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日微信好友数量")."</th>
288
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日新粉成单数")."</th>
289
+                <th>".iconv("UTF-8", "GB2312//IGNORE","当日新粉成交额")."</th>
290
+                <th>".iconv("UTF-8", "GB2312//IGNORE","老粉成单数")."</th>
291
+                <th>".iconv("UTF-8", "GB2312//IGNORE","老粉成交额")."</th>
292
+                <th>".iconv("UTF-8", "GB2312//IGNORE","复购单数")."</th>
293
+                <th>".iconv("UTF-8", "GB2312//IGNORE","复购成交额")."</th>
294
+                <th>".iconv("UTF-8", "GB2312//IGNORE","总成交额")."</th>
295
+                <th>".iconv("UTF-8", "GB2312//IGNORE","总投放成本")."</th>              
296
+                <th>".iconv("UTF-8", "GB2312//IGNORE","货品成本")."</th>              
297
+                <th>".iconv("UTF-8", "GB2312//IGNORE","毛利")."</th>              
298
+                <th>".iconv("UTF-8", "GB2312//IGNORE","综合成单率")."</th>              
299
+
300
+            </tr>";
301
+
302
+            foreach ($result as $k => $v)
303
+            {
304
+                #当日微信好友数量
305
+                $custDetail = CustDetail::select(DB::raw('sum(fan_add) as wx_fan_add'))->where('dtime', $v['dtime'])->where('is_del', 0)->first();
306
+                $v['wx_fan_add'] = $custDetail->wx_fan_add; //当日微信粉数
307
+                
308
+                #当日订单总计:
309
+                $order = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count, sum(cost) as order_cost'))->where('createTime','>=', $v['dtime'])->where('createTime','<', $v['dtime'].' 23:59:59')->where('is_del', 0)->first();
310
+                #当日新粉成单:
311
+                $phones = DB::table('customers')->where('fanTime', $v['dtime'])->lists('phone');
312
+                $new_order = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count'))->where('createTime','>=', $v['dtime'])->where('createTime','<', $v['dtime'].' 23:59:59')->where('is_del', 0)->whereIn('receiverMobile', $phones)->first();
313
+                // 1.当日新粉成单数
314
+                $v['new_order_count'] = $new_order->order_count;
315
+                // 2.当日新粉成交额 
316
+                $v['new_order_amount'] = $new_order->order_amount;
317
+                // 3.老粉成单数
318
+                $v['old_order_count'] = $order->order_count - $new_order->order_count;
319
+                // 4.老粉成交额
320
+                $v['old_order_amount'] = $order->order_amount - $new_order->order_amount;
321
+                // 5.总成交额
322
+                $v['order_amount'] = $order->order_amount;
323
+
324
+                #复购单数、复购成交额
325
+                $fugou = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count'))->where('createTime','>=', $v['dtime'])->where('createTime','<', $v['dtime'].' 23:59:59')->where('is_del', 0)->where('is_fugou', 1)->first();
326
+                $v['fugou_order_count'] = $fugou->order_count;
327
+                $v['fugou_order_amount'] = $fugou->order_amount;
328
+                #货品成本
329
+                $v['order_cost'] = $order->order_cost;
330
+                #毛利
331
+                $v['profit'] = $v['order_amount'] - $v['order_cost'] - $v['total_cost'];
332
+                //综合成单率
333
+                $v['order_rate'] = '';
334
+
335
+                $data_str .= "<tr>";
336
+                $data_str .= "<td>".$v['dtime']."</td>";
337
+                $data_str .= "<td>".$v['total_fan_add']."</td>";
338
+                $data_str .= "<td>".$v['wx_fan_add']."</td>";
339
+                $data_str .= "<td>".$v['new_order_count']."</td>";
340
+                $data_str .= "<td>".$v['new_order_amount']."</td>";
341
+                $data_str .= "<td>".$v['old_order_count']."</td>";
342
+                $data_str .= "<td>".$v['old_order_amount']."</td>";
343
+                $data_str .= "<td>".$v['fugou_order_count']."</td>";
344
+                $data_str .= "<td>".$v['fugou_order_amount']."</td>";
345
+                $data_str .= "<td>".$v['order_amount']."</td>";
346
+                $data_str .= "<td>".$v['total_cost']."</td>";
347
+                $data_str .= "<td>".$v['order_cost']."</td>";
348
+                $data_str .= "<td>".$v['profit']."</td>";
349
+                $data_str .= "<td>".$v['order_rate']."</td>";
350
+
351
+                $data_str .= "</tr>";
352
+            }
353
+
354
+        $data_str .= "</table>";
355
+        echo $data_str;
356
+        exit;       
357
+    }
358
+}
359
+

+ 9 - 1
app/Http/routes.php

@@ -69,7 +69,7 @@ Route::group(['prefix' => 'admin'], function(){
69 69
         Route::get('/order/categoods/{category}', 'Admin\OrderController@categoods');
70 70
         Route::get('/order/teamAdmins/{team_id}', 'Admin\OrderController@teamAdmins');
71 71
 
72
-        //数据报
72
+        //数据
73 73
         Route::get('/custreport/detailindex', 'Admin\CustReportController@detailindex');
74 74
         Route::get('/custreport/detail_export', 'Admin\CustReportController@detail_export');
75 75
         Route::get('/custreport/detailcreate', 'Admin\CustReportController@detailcreate');
@@ -85,6 +85,14 @@ Route::group(['prefix' => 'admin'], function(){
85 85
         Route::get('/custreport/totaledit/{id}', 'Admin\CustReportController@totaledit');
86 86
         Route::post('/custreport/totalupdate', 'Admin\CustReportController@totalupdate');
87 87
         Route::get('/custreport/totaldelete/{id}', 'Admin\CustReportController@totaldelete');
88
+
89
+        //数据报表
90
+        //当日数据统计
91
+        Route::get('/statistics/fanDay', 'Admin\StatisticsController@fanDay');
92
+        Route::get('/statistics/fanDay_export', 'Admin\StatisticsController@fanDay_export');
93
+        //分片数据统计
94
+        Route::get('/statistics/orderDay', 'Admin\StatisticsController@orderDay');
95
+        Route::get('/statistics/orderDay_export', 'Admin\StatisticsController@orderDay_export');
88 96
         
89 97
     });
90 98
     

+ 12 - 0
resources/views/admin/index.blade.php

@@ -73,6 +73,18 @@
73 73
                     </ul>
74 74
                 </dd>
75 75
             </dl>
76
+
77
+            <dl id="menu-order">
78
+                <dt @if(!isset($res['statistics/manage'])) style="display:none;list-style-type:none;" @endif><i class="Hui-iconfont">&#xe628;</i> 报表管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
79
+                <dd>
80
+                    <ul>                       
81
+                        <li @if(!isset($res['statistics/fanDay'])) style="display:none;list-style-type:none;" @endif><a data-href="{{url('admin/statistics/fanDay')}}" data-title="当日数据统计" href="javascript:void(0)">当日数据统计</a></li>                        
82
+                    </ul>
83
+                    <ul>                       
84
+                        <li @if(!isset($res['statistics/orderDay'])) style="display:none;list-style-type:none;" @endif><a data-href="{{url('admin/statistics/orderDay')}}" data-title="分片数据统计" href="javascript:void(0)">分片数据统计</a></li>                        
85
+                    </ul>
86
+                </dd>
87
+            </dl>
76 88
                      
77 89
 
78 90
         </div>

+ 1 - 1
resources/views/custreport/detaillist.blade.php

@@ -27,7 +27,7 @@
27 27
         </div>
28 28
         
29 29
         <div class="mt-20">
30
-            <table class="table table-bcustreport table-bcustreported table-bg table-hover table-sort">
30
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
31 31
                 <thead>
32 32
                 <tr class="text-c">
33 33
                     <th width="8%">日期</th>

+ 15 - 0
resources/views/custreport/totalcreate.blade.php

@@ -36,6 +36,21 @@
36 36
                     <input id="dtime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:22%;text-align:center;" name="dtime" value="">                    
37 37
                 </div>
38 38
             </div>
39
+
40
+            <div class="row cl">
41
+                <label class="form-label col-xs-4 col-sm-2">
42
+                    选择团队:</label>
43
+                <div class="formControls col-xs-6 col-sm-6">
44
+                    <span class="select-box">
45
+                        <select  size="1" name="team_id" id='team'>
46
+                            <option value="0" @if(old('team_id')=='') selected @endif>- 请选择 -</option>
47
+                            @foreach($teamlist as $v)
48
+                                <option value="{{$v['id']}}" @if(old('team_id')==$v['id']) selected @endif>{{$v['name']}}</option>
49
+                            @endforeach
50
+                        </select>
51
+                    </span>
52
+                </div>
53
+            </div>
39 54
         
40 55
             <div class="row cl">
41 56
                 <div class="col-9 col-offset-2">

+ 15 - 0
resources/views/custreport/totaledit.blade.php

@@ -38,6 +38,21 @@
38 38
                     <input id="dtime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:22%;text-align:center;" name="dtime" value="{{$custreport['dtime']}}">                    
39 39
                 </div>
40 40
             </div>
41
+
42
+            <div class="row cl">
43
+                <label class="form-label col-xs-4 col-sm-2">
44
+                    选择团队:</label>
45
+                <div class="formControls col-xs-6 col-sm-6">
46
+                    <span class="select-box">
47
+                        <select  size="1" name="team_id" id='team'>
48
+                            <option value="0" @if($custreport['team_id']=='') selected @endif>- 请选择 -</option>
49
+                            @foreach($teamlist as $v)
50
+                                <option value="{{$v['id']}}" @if($custreport['team_id']==$v['id']) selected @endif>{{$v['name']}}</option>
51
+                            @endforeach
52
+                        </select>
53
+                    </span>
54
+                </div>
55
+            </div>
41 56
                
42 57
             @endif
43 58
 

+ 17 - 6
resources/views/custreport/totallist.blade.php

@@ -5,7 +5,13 @@
5 5
         <div>
6 6
             <div>
7 7
                 <a class="btn btn-primary radius" onclick="custreport_add('新增', 0)" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 新增数据</a>
8
-                             
8
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="所属团队"/>
9
+                <select style="width:10%;text-align:center" id='team_id' name="team_id">
10
+                    <option value="0" @if($team_id=='') selected @endif>-- 选择团队 --</option>
11
+                    @foreach($teamlist as $v)
12
+                        <option value="{{$v['id']}}" @if($team_id==$v['id']) selected @endif>{{$v['name']}}</option>
13
+                    @endforeach
14
+                </select>              
9 15
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>
10 16
                 <input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">
11 17
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="结束时间"/>
@@ -19,12 +25,13 @@
19 25
         </div>
20 26
         
21 27
         <div class="mt-20">
22
-            <table class="table table-bcustreport table-bcustreported table-bg table-hover table-sort">
28
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
23 29
                 <thead>
24 30
                 <tr class="text-c">
25 31
                     <th width="8%">日期</th>
26 32
                     <th width="8%">总加粉数</th>
27 33
                     <th width="8%">总成本</th>                                 
34
+                    <th width="8%">所属团队</th>                                 
28 35
                     <th width="6%">操作</th>                  
29 36
                 </tr>
30 37
                 </thead>
@@ -34,7 +41,8 @@
34 41
                         <tr class="text-c" style=" text-align:center;">                           
35 42
                             <td>{{$a['dtime']}}</td>                            
36 43
                             <td>{{$a['total_fan_add']}}</td>                            
37
-                            <td>{{$a['total_cost']}}</td>                                                                                                                                     
44
+                            <td>{{$a['total_cost']}}</td>                            
45
+                            <td>{{$a['team_name']}}</td>                                                                                                                                     
38 46
                             <td>
39 47
                                 <a style="text-decoration:none" onClick='custreport_edit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>
40 48
                                 <a style="text-decoration:none" onClick='custreport_del("删除","{{$a['id']}}")' href="javascript:;" title="删除"><span class="btn btn-primary radius">删除</span></a>
@@ -87,14 +95,16 @@
87 95
         function user_search(){
88 96
             var stime = $('#stime').val();
89 97
             var etime = $('#etime').val();
98
+            var team_id = $('#team_id').val();
90 99
             var page = {{$page}};
91
-            location.href = 'totalindex?page='+page+'&stime='+stime+'&etime='+etime;
100
+            location.href = 'totalindex?page='+page+'&stime='+stime+'&etime='+etime+'&team_id='+team_id;
92 101
         }
93 102
         //导出
94 103
         function custreport_export(){
95 104
             var stime = $('#stime').val();
96 105
             var etime = $('#etime').val();
97
-            location.href = '/admin/custreport/total_export?stime='+stime+'&etime='+etime;
106
+            var team_id = $('#team_id').val();
107
+            location.href = '/admin/custreport/total_export?stime='+stime+'&etime='+etime+'&team_id='+team_id;
98 108
         }
99 109
        
100 110
         /*分页*/
@@ -106,7 +116,8 @@
106 116
             callback: function(num) {
107 117
                 var stime = $('#stime').val();
108 118
                 var etime = $('#etime').val();
109
-                location.href='totalindex?page='+num+'&stime='+stime+'&etime='+etime;
119
+                var team_id = $('#team_id').val();
120
+                location.href='totalindex?page='+num+'&stime='+stime+'&etime='+etime+'&team_id='+team_id;
110 121
             }
111 122
         })
112 123
         

+ 126 - 0
resources/views/statistics/fanDay.blade.php

@@ -0,0 +1,126 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    <div class="page-container">
5
+        <div>
6
+            <div>                            
7
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>
8
+                <input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">
9
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="结束时间"/>
10
+                <input id="etime"type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="etime" value="{{$etime?$etime:''}}">
11
+               
12
+                
13
+                <a class="btn btn-primary radius"  style="margin-left: 5px" onclick="user_search()" href="javascript:;">搜索</a>
14
+                <a class="btn btn-primary radius" onclick="statistics_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出数据</a>
15
+                
16
+            </div>
17
+        </div>
18
+        
19
+        <div class="mt-20">
20
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
21
+                <thead>
22
+                <tr class="text-c">
23
+                    <th width="8%">日期</th>
24
+                    <th width="8%">当日投放金额</th>
25
+                    <th width="8%">当日公众号进粉</th>                                 
26
+                    <th width="8%">当日进粉成本</th>                                 
27
+                    <th width="8%">当日微信粉</th>                                 
28
+                    <th width="8%">当日微信粉成本</th>                                 
29
+                    <th width="8%">当日订单数</th>                                 
30
+                    <th width="8%">当日销售额</th>                                 
31
+                    <th width="8%">当日新粉回复量</th>                                 
32
+                    <th width="8%">当日新粉回复率</th>                                 
33
+                    <th width="8%">当日老粉主动咨询量</th>                                                 
34
+                </tr>
35
+                </thead>
36
+                <tbody>
37
+                @if($result)
38
+                    @foreach($result as $a)
39
+                        <tr class="text-c" style=" text-align:center;">                           
40
+                            <td>{{$a['dtime']}}</td>                            
41
+                            <td>{{$a['total_cost']}}</td>                            
42
+                            <td>{{$a['total_fan_add']}}</td>                            
43
+                            <td>{{$a['cost_fan']}}</td>                            
44
+                            <td>{{$a['wx_fan_add']}}</td>                            
45
+                            <td>{{$a['cost_wx_fan']}}</td>                            
46
+                            <td>{{$a['order_count']}}</td>                            
47
+                            <td>{{$a['order_amount']}}</td>                            
48
+                            <td>{{$a['total_new_reply']}}</td>                            
49
+                            <td>{{$a['new_reply_rate']}}</td>                            
50
+                            <td>{{$a['total_old_consult']}}</td>                                                                               
51
+                        </tr>
52
+                    @endforeach
53
+                @endif
54
+                </tbody>
55
+            </table>
56
+        </div>
57
+        <div id="page" class="page_div"></div>
58
+    </div>
59
+    
60
+    <!--_footer 作为公共模版分离出去-->
61
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
62
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
63
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
64
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
65
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
66
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
67
+    <!--/_footer 作为公共模版分离出去-->
68
+    <!--/_footer 作为公共模版分离出去-->
69
+     <script type="text/javascript">
70
+        /*广告-添加*/
71
+        function statistics_add(title){
72
+            location.href="/admin/statistics/totalcreate";
73
+        }
74
+        /*广告-编辑*/
75
+        function statistics_edit(title,id){
76
+            location.href="/admin/statistics/totaledit/"+id;
77
+        }
78
+        /*广告-设为首页显示*/
79
+        function up(obj,id){
80
+            layer.confirm('确认要设为首页显示吗?',function(index){
81
+                location.href='/admin/statistics/up/'+id;
82
+            });
83
+        }
84
+        /*广告-移除*/
85
+        function statistics_del(obj,id){
86
+            layer.confirm('确认要删除吗?',function(index){
87
+                location.href='/admin/statistics/totaldelete/'+id;
88
+            });
89
+        }
90
+        /*广告-设为首页隐藏*/
91
+        function down(obj,id){
92
+            layer.confirm('确认要设为首页隐藏吗?',function(index){
93
+                location.href='/admin/statistics/down/'+id;
94
+            });
95
+        }
96
+        function user_search(){
97
+            var stime = $('#stime').val();
98
+            var etime = $('#etime').val();
99
+            var page = {{$page}};
100
+            location.href = 'fanDay?page='+page+'&stime='+stime+'&etime='+etime;
101
+        }
102
+        //导出
103
+        function statistics_export(){
104
+            var stime = $('#stime').val();
105
+            var etime = $('#etime').val();
106
+            location.href = '/admin/statistics/fanDay_export?stime='+stime+'&etime='+etime;
107
+        }
108
+       
109
+        /*分页*/
110
+        
111
+        $("#page").paging({
112
+            pageNo:{{$page}},
113
+            totalPage: {{$pages}},
114
+            totalSize: {{$count}},
115
+            callback: function(num) {
116
+                var stime = $('#stime').val();
117
+                var etime = $('#etime').val();
118
+                location.href='fanDay?page='+num+'&stime='+stime+'&etime='+etime;
119
+            }
120
+        })
121
+        
122
+    </script>
123
+   
124
+    </body>
125
+
126
+@endsection

+ 133 - 0
resources/views/statistics/orderDay.blade.php

@@ -0,0 +1,133 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    <div class="page-container">
5
+        <div>
6
+            <div>                            
7
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>
8
+                <input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">
9
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="结束时间"/>
10
+                <input id="etime"type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="etime" value="{{$etime?$etime:''}}">
11
+               
12
+                
13
+                <a class="btn btn-primary radius"  style="margin-left: 5px" onclick="user_search()" href="javascript:;">搜索</a>
14
+                <a class="btn btn-primary radius" onclick="statistics_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出数据</a>
15
+                
16
+            </div>
17
+        </div>
18
+        
19
+        <div class="mt-20">
20
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
21
+                <thead>
22
+                <tr class="text-c">
23
+                    <th width="8%">日期</th>
24
+                    <th width="8%">当日进粉数量</th>
25
+                    <th width="8%">当日微信好友数量</th>                                 
26
+                    <th width="8%">当日新粉成单数</th>                                 
27
+                    <th width="8%">当日新粉成交额</th>                                 
28
+                    <th width="8%">老粉成单数</th>                                 
29
+                    <th width="8%">老粉成交额</th>                                 
30
+                    <th width="8%">复购单数</th>                                 
31
+                    <th width="8%">复购成交额</th>                                 
32
+                    <th width="8%">总成交额</th>                                 
33
+                    <th width="8%">总投放成本</th>                                                 
34
+                    <th width="8%">货品成本</th>                                                 
35
+                    <th width="8%">毛利</th>                                                 
36
+                    <th width="8%">综合成单率</th>                                                 
37
+                </tr>
38
+                </thead>
39
+                <tbody>
40
+                @if($result)
41
+                    @foreach($result as $a)
42
+                        <tr class="text-c" style=" text-align:center;">                           
43
+                            <td>{{$a['dtime']}}</td>                            
44
+                            <td>{{$a['total_fan_add']}}</td>                            
45
+                            <td>{{$a['wx_fan_add']}}</td>                            
46
+                            <td>{{$a['new_order_count']}}</td>                            
47
+                            <td>{{$a['new_order_amount']}}</td>                            
48
+                            <td>{{$a['old_order_count']}}</td>                            
49
+                            <td>{{$a['old_order_amount']}}</td>                            
50
+                            <td>{{$a['fugou_order_count']}}</td>                            
51
+                            <td>{{$a['fugou_order_amount']}}</td>                            
52
+                            <td>{{$a['order_amount']}}</td>                            
53
+                            <td>{{$a['total_cost']}}</td>                            
54
+                            <td>{{$a['order_cost']}}</td>                            
55
+                            <td>{{$a['profit']}}</td>                            
56
+                            <td>{{$a['order_rate']}}</td>                                                       
57
+                                                                                         
58
+                        </tr>
59
+                    @endforeach
60
+                @endif
61
+                </tbody>
62
+            </table>
63
+        </div>
64
+        <div id="page" class="page_div"></div>
65
+    </div>
66
+    
67
+    <!--_footer 作为公共模版分离出去-->
68
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
69
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
70
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
71
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
72
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
73
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
74
+    <!--/_footer 作为公共模版分离出去-->
75
+    <!--/_footer 作为公共模版分离出去-->
76
+     <script type="text/javascript">
77
+        /*广告-添加*/
78
+        function statistics_add(title){
79
+            location.href="/admin/statistics/totalcreate";
80
+        }
81
+        /*广告-编辑*/
82
+        function statistics_edit(title,id){
83
+            location.href="/admin/statistics/totaledit/"+id;
84
+        }
85
+        /*广告-设为首页显示*/
86
+        function up(obj,id){
87
+            layer.confirm('确认要设为首页显示吗?',function(index){
88
+                location.href='/admin/statistics/up/'+id;
89
+            });
90
+        }
91
+        /*广告-移除*/
92
+        function statistics_del(obj,id){
93
+            layer.confirm('确认要删除吗?',function(index){
94
+                location.href='/admin/statistics/totaldelete/'+id;
95
+            });
96
+        }
97
+        /*广告-设为首页隐藏*/
98
+        function down(obj,id){
99
+            layer.confirm('确认要设为首页隐藏吗?',function(index){
100
+                location.href='/admin/statistics/down/'+id;
101
+            });
102
+        }
103
+        function user_search(){
104
+            var stime = $('#stime').val();
105
+            var etime = $('#etime').val();
106
+            var page = {{$page}};
107
+            location.href = 'orderDay?page='+page+'&stime='+stime+'&etime='+etime;
108
+        }
109
+        //导出
110
+        function statistics_export(){
111
+            var stime = $('#stime').val();
112
+            var etime = $('#etime').val();
113
+            location.href = '/admin/statistics/orderDay_export?stime='+stime+'&etime='+etime;
114
+        }
115
+       
116
+        /*分页*/
117
+        
118
+        $("#page").paging({
119
+            pageNo:{{$page}},
120
+            totalPage: {{$pages}},
121
+            totalSize: {{$count}},
122
+            callback: function(num) {
123
+                var stime = $('#stime').val();
124
+                var etime = $('#etime').val();
125
+                location.href='orderDay?page='+num+'&stime='+stime+'&etime='+etime;
126
+            }
127
+        })
128
+        
129
+    </script>
130
+   
131
+    </body>
132
+
133
+@endsection