Kaynağa Gözat

粉丝分日数据统计

sunhao 5 yıl önce
ebeveyn
işleme
35b8b9091a

+ 17 - 0
app/CustDetail.php

@@ -0,0 +1,17 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: Administrator
5
+ * Date: 2017/12/5
6
+ * Time: 15:07
7
+ */
8
+
9
+namespace App;
10
+use Illuminate\Database\Eloquent\Model;
11
+
12
+class CustDetail extends Model
13
+{
14
+    public $timestamps = false;
15
+    protected $table = "cust_day_detail";
16
+   
17
+}

+ 17 - 0
app/CustTotal.php

@@ -0,0 +1,17 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: Administrator
5
+ * Date: 2017/12/5
6
+ * Time: 15:07
7
+ */
8
+
9
+namespace App;
10
+use Illuminate\Database\Eloquent\Model;
11
+
12
+class CustTotal extends Model
13
+{
14
+    public $timestamps = false;
15
+    protected $table = "cust_day_total";
16
+   
17
+}

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

@@ -0,0 +1,500 @@
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 custReportController extends Controller
18
+{
19
+	public function totalindex(Request $request){
20
+        $page = (int)$request->input('page');
21
+        $pageSize = 20;
22
+        if($page<=0){
23
+            $page = 1;
24
+        }
25
+
26
+        $offset = ($page-1) * $pageSize;
27
+        
28
+        $stime = $request->input('stime');
29
+        $etime = $request->input('etime');
30
+
31
+        $count = CustTotal::where(function($query) use($stime, $etime){
32
+            if($stime) $query->where('dtime', '>=', $stime);
33
+            if($etime) $query->where('dtime', '<=', $etime);
34
+        })->where('is_del',0)->count();
35
+        if ($count > 1) {
36
+            // 总页数
37
+            $pages = ceil($count/$pageSize);
38
+        }else{
39
+            // 总页数
40
+            $pages = 1;
41
+        }
42
+
43
+        $result = CustTotal::where(function($query) use($stime, $etime){
44
+            if($stime) $query->where('dtime', '>=', $stime);
45
+            if($etime) $query->where('dtime', '<=', $etime);
46
+        })->where('is_del',0)->orderBy('id', 'desc')->offset($offset)->limit($pageSize)->get();
47
+        $result = json_decode(json_encode($result),true);
48
+
49
+        return view('custreport/totallist', ['result' =>$result,
50
+            'page'              =>$page,
51
+            'count'             =>$count,
52
+            'pages'             =>$pages,          
53
+            'stime'             =>$stime,
54
+            'etime'             =>$etime,
55
+            ]);
56
+    }
57
+
58
+    /**
59
+     * 添加订单
60
+     * @return \Illuminate\View\View
61
+     */
62
+    public function totalcreate(Request $request)
63
+    {
64
+        return view('custreport/totalcreate');
65
+    }
66
+    /**
67
+     * 分组管理-进行添加操作
68
+     * @param Request $request
69
+     * @return \Illuminate\Http\RedirectResponse
70
+     */
71
+    public function totalstore(Request $request)
72
+    {       
73
+        $this->validate($request, [
74
+            'total_cost'           => 'required', 
75
+            'total_fan_add'           => 'required',   
76
+            'dtime'           => 'required',   
77
+        ], [                  
78
+            'total_cost.required'           => '总成本不能为空',                   
79
+            'total_fan_add.required'           => '总加粉数不能为空',                                    
80
+            'dtime.required'           => '日期不能为空',                                    
81
+        ]);
82
+        //数据库-新增数据
83
+        $custreport = array();
84
+       
85
+        $custreport['total_cost'] = $request->input('total_cost'); 
86
+        $custreport['total_fan_add'] = $request->input('total_fan_add'); 
87
+        $custreport['dtime'] = $request->input('dtime'); 
88
+                
89
+        $res = DB::table('cust_day_total')->insert($custreport);            
90
+        return redirect('/admin/custreport/totalindex')->with('info', '添加成功'); 
91
+       
92
+    }
93
+
94
+    /**
95
+     * 分组管理-编辑分组界面
96
+     * @param $id
97
+     * @return \Illuminate\View\View
98
+     */
99
+    public function totaledit($id,Request $request)
100
+    {
101
+        
102
+        $data = CustTotal::where('id', $id)->first();
103
+        return view('custreport/totaledit', [       
104
+            'custreport' => $data,
105
+        ]);
106
+
107
+    }
108
+
109
+    /**
110
+     * 分组管理-进行编辑操作
111
+     * @param Request $request
112
+     * @return \Illuminate\Http\RedirectResponse
113
+     */
114
+    public function totalupdate(Request $request)
115
+    {            
116
+        $this->validate($request, [
117
+            'id'                  => 'required',
118
+            'total_cost'          => 'required', 
119
+            'total_fan_add'       => 'required',   
120
+            'dtime'               => 'required',   
121
+        ], [                  
122
+            'id.required'              => 'id不能为空',                   
123
+            'total_cost.required'      => '总成本不能为空',                   
124
+            'total_fan_add.required'   => '总加粉数不能为空',                                    
125
+            'dtime.required'           => '日期不能为空',                                    
126
+        ]);
127
+       
128
+        $custreport = array();
129
+        $custreport['total_cost'] = $request->input('total_cost'); 
130
+        $custreport['total_fan_add'] = $request->input('total_fan_add'); 
131
+        $custreport['dtime'] = $request->input('dtime'); 
132
+
133
+        $id = (int)$request->input('id');
134
+        $res = DB::table('cust_day_total')->where('id', $id)->update($custreport);        
135
+        return redirect('/admin/custreport/totalindex')->with('info', '更新成功');         
136
+    }
137
+
138
+    /**
139
+     * 分组管理-进行删除操作
140
+     * @param Request $request
141
+     * @return \Illuminate\Http\RedirectResponse
142
+     */
143
+    public function totaldelete($id)
144
+    {
145
+        $custreport = CustTotal::find($id);
146
+        $custreport->is_del = 1;
147
+        if ($custreport ->save()){
148
+            return redirect('/admin/custreport/totalindex')->with('info', '删除成功');
149
+        }
150
+    }
151
+
152
+    public function total_export(Request $request){
153
+        
154
+        $self_role = session('role_name');
155
+        if($self_role == '超级管理员' || $self_role == '团队主管'){
156
+            $admin_id = $request->input('admin_id');
157
+        }else{
158
+            $admin_id = session('admin_id');
159
+        }
160
+        $stime = $request->input('stime');
161
+        $etime = $request->input('etime');
162
+
163
+        $result = custreport::where(function($query) use($admin_id, $stime, $etime){
164
+            if($admin_id) $query->where('admin_id',  $admin_id);
165
+            if($stime) $query->where('createTime', '>=', $stime);
166
+            if($etime) $query->where('createTime', '<=', $etime);
167
+        })->where('is_del',0)->custreportBy('id', 'desc')->get();
168
+        $result = json_decode(json_encode($result),true);
169
+
170
+
171
+        $filename="订单数据.xls";
172
+        header("Content-type:application/vnd.ms-excel");
173
+        Header("Accept-Ranges:bytes");
174
+        Header("Content-Disposition:attachment;filename=".$filename); //$filename导出的文件名
175
+        header("Pragma: no-cache");
176
+        header("Expires: 0");
177
+
178
+    $data_str = '<html xmlns:o="urn:schemas-microsoft-com:office:office"
179
+            xmlns:x="urn:schemas-microsoft-com:office:excel"
180
+            xmlns="http://www.w3.org/TR/REC-html40">
181
+            <head>
182
+            <meta http-equiv="expires" content="Mon, 06 Jan 1999 00:00:01 GMT">
183
+            <meta http-equiv=Content-Type content="text/html; charset=gb2312">
184
+            <!--[if gte mso 9]><xml>
185
+            <x:ExcelWorkbook>
186
+            <x:ExcelWorksheets>
187
+            <x:ExcelWorksheet>
188
+            <x:Name></x:Name>
189
+            <x:WorksheetOptions>
190
+            <x:DisplayGridlines/>
191
+            </x:WorksheetOptions>
192
+            </x:ExcelWorksheet>
193
+            </x:ExcelWorksheets>
194
+            </x:ExcelWorkbook>
195
+            </xml><![endif]-->
196
+            </head>';
197
+
198
+    $data_str .= "
199
+            <table>
200
+            <tr>
201
+                <th>".iconv("UTF-8", "GB2312//IGNORE","销售微信号")."</th>
202
+                <th>".iconv("UTF-8", "GB2312//IGNORE","销售团队")."</th>
203
+                <th>".iconv("UTF-8", "GB2312//IGNORE","销售")."</th>
204
+                <th>".iconv("UTF-8", "GB2312//IGNORE","订单时间")."</th>
205
+                <th>".iconv("UTF-8", "GB2312//IGNORE","加粉时间")."</th>
206
+                <th>".iconv("UTF-8", "GB2312//IGNORE","是否复购")."</th>
207
+                <th>".iconv("UTF-8", "GB2312//IGNORE","订单金额")."</th>
208
+                <th>".iconv("UTF-8", "GB2312//IGNORE","订单商品")."</th>
209
+                <th>".iconv("UTF-8", "GB2312//IGNORE","是否退补单")."</th>
210
+                <th>".iconv("UTF-8", "GB2312//IGNORE","配送地址")."</th>
211
+                <th>".iconv("UTF-8", "GB2312//IGNORE","配送姓名")."</th>
212
+                <th>".iconv("UTF-8", "GB2312//IGNORE","配送电话")."</th>
213
+                <th>".iconv("UTF-8", "GB2312//IGNORE","供应商成本")."</th>
214
+                <th>".iconv("UTF-8", "GB2312//IGNORE","顺丰单号")."</th>                
215
+
216
+            </tr>";
217
+            foreach ($result as $k => $v)
218
+            {
219
+                #销售
220
+                $admin = DB::table('admin')->where('id', $v['admin_id'])->first();
221
+                $v['wx_id'] = isset($admin->wx_id) ? $admin->wx_id : '';
222
+                #team
223
+                $team = DB::table('teams')->where('id', $v['team_id'])->first();
224
+                $v['team_name'] = isset($team->name) ? $team->name : '';
225
+                #加粉时间
226
+                $customr = DB::table('customers')->where('phone', $v['receiverMobile'])->first();
227
+                $v['fanTime'] = isset($customr->fanTime) ? $customr->fanTime : '';
228
+
229
+                $v['receiverMobile'] = substr($v['receiverMobile'], 0, 3).'****'.substr($v['receiverMobile'], 7);
230
+
231
+                $fugou = $v['is_fugou']==1? '是' : '否';
232
+                $is_refund = $v['is_refund']==1? '是' : '否';
233
+                $address = $v['receiverState'].$v['receiverCity'].$v['receiverDistrict'].$v['receiverAddress'];
234
+                $data_str .= "<tr>";
235
+                $data_str .= "<td>".$v['wx_id']."</td>";
236
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["team_name"])."</td>";
237
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["admin_name"])."</td>";
238
+                $data_str .= "<td>".$v['createTime']."</td>";
239
+                $data_str .= "<td>".$v['fanTime']."</td>";
240
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $fugou)."</td>";
241
+                $data_str .= "<td>".$v['receivedAmount']."</td>";
242
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["goods_note"])."</td>";
243
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $is_refund)."</td>";
244
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $address)."</td>";
245
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["receiverName"])."</td>";
246
+                $data_str .= "<td>".$v['receiverMobile']."</td>";
247
+                $data_str .= "<td>".$v['cost']."</td>";
248
+                $data_str .= "<td style='vnd.ms-excel.numberformat:@'>".$v["logistics_id"]."</td>";
249
+                $data_str .= "</tr>";
250
+            }
251
+
252
+        $data_str .= "</table>";
253
+        echo $data_str;
254
+        exit;       
255
+    }
256
+
257
+    public function detailindex(Request $request){
258
+        $page = (int)$request->input('page');
259
+        $pageSize = 20;
260
+        if($page<=0){
261
+            $page = 1;
262
+        }
263
+
264
+        $offset = ($page-1) * $pageSize;
265
+        
266
+        $self_role = session('role_name');
267
+        if($self_role == '超级管理员' || $self_role == '团队主管'){
268
+            $admin_id = $request->input('admin_id');
269
+            $search_admin = 1;
270
+        }else{
271
+            $admin_id = session('admin_id');
272
+            $search_admin = 0;
273
+        }
274
+
275
+        $stime = $request->input('stime');
276
+        $etime = $request->input('etime');
277
+
278
+        $count = CustDetail::where(function($query) use($admin_id, $stime, $etime){
279
+            if($admin_id) $query->where('admin_id', $admin_id);
280
+            if($stime) $query->where('dtime', '>=', $stime);
281
+            if($etime) $query->where('dtime', '<=', $etime);
282
+        })->where('is_del',0)->count();
283
+        if ($count > 1) {
284
+            // 总页数
285
+            $pages = ceil($count/$pageSize);
286
+        }else{
287
+            // 总页数
288
+            $pages = 1;
289
+        }
290
+
291
+        $result = CustDetail::where(function($query) use($admin_id, $stime, $etime){
292
+            if($admin_id) $query->where('admin_id', $admin_id);
293
+            if($stime) $query->where('dtime', '>=', $stime);
294
+            if($etime) $query->where('dtime', '<=', $etime);
295
+        })->where('is_del',0)->orderBy('id', 'desc')->offset($offset)->limit($pageSize)->get();
296
+        $result = json_decode(json_encode($result),true);
297
+
298
+        $adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
299
+        $adminList = json_decode(json_encode($adminList), true);
300
+
301
+        return view('custreport/detaillist', ['result' =>$result,
302
+            'page'              =>$page,
303
+            'count'             =>$count,
304
+            'pages'             =>$pages,          
305
+            'stime'             =>$stime,
306
+            'etime'             =>$etime,
307
+            'admin_id'          =>$admin_id,
308
+            'search_admin'      =>$search_admin,
309
+            'adminlist'         =>$adminList,
310
+            ]);
311
+    }
312
+
313
+    /**
314
+     * 添加订单
315
+     * @return \Illuminate\View\View
316
+     */
317
+    public function detailcreate(Request $request)
318
+    {
319
+        return view('custreport/detailcreate');
320
+    }
321
+    /**
322
+     * 分组管理-进行添加操作
323
+     * @param Request $request
324
+     * @return \Illuminate\Http\RedirectResponse
325
+     */
326
+    public function detailstore(Request $request)
327
+    {       
328
+        $this->validate($request, [
329
+            'old_consult'           => 'required', 
330
+            'new_consult'           => 'required', 
331
+            'fan_add'           => 'required',   
332
+            'dtime'           => 'required',   
333
+        ], [                  
334
+            'old_consult.required'           => '老粉咨询不能为空',                   
335
+            'new_consult.required'           => '新粉咨询数不能为空',                                    
336
+            'fan_add.required'           => '加粉数不能为空',                                    
337
+            'dtime.required'           => '日期不能为空',                                    
338
+        ]);
339
+        //数据库-新增数据
340
+        $custreport = array();
341
+       
342
+        $custreport['old_consult'] = $request->input('old_consult'); 
343
+        $custreport['new_consult'] = $request->input('new_consult'); 
344
+        $custreport['fan_add'] = $request->input('fan_add'); 
345
+        $custreport['dtime'] = $request->input('dtime'); 
346
+        $custreport['admin_id'] = session('admin_id'); 
347
+        $custreport['admin_name'] = session('real_name'); 
348
+                
349
+        $res = DB::table('cust_day_detail')->insert($custreport);            
350
+        return redirect('/admin/custreport/detailindex')->with('info', '添加成功'); 
351
+       
352
+    }
353
+
354
+    /**
355
+     * 分组管理-编辑分组界面
356
+     * @param $id
357
+     * @return \Illuminate\View\View
358
+     */
359
+    public function detailedit($id,Request $request)
360
+    {
361
+        
362
+        $data = CustDetail::where('id', $id)->first();
363
+        return view('custreport/detailedit', [       
364
+            'custreport' => $data,
365
+        ]);
366
+
367
+    }
368
+
369
+    /**
370
+     * 分组管理-进行编辑操作
371
+     * @param Request $request
372
+     * @return \Illuminate\Http\RedirectResponse
373
+     */
374
+    public function detailupdate(Request $request)
375
+    {            
376
+        $this->validate($request, [
377
+            'id'           => 'required', 
378
+            'old_consult'           => 'required', 
379
+            'new_consult'           => 'required', 
380
+            'fan_add'           => 'required',   
381
+            'dtime'           => 'required',   
382
+        ], [                  
383
+            'id.required'           => 'id不能为空',                   
384
+            'old_consult.required'           => '老粉咨询不能为空',                   
385
+            'new_consult.required'           => '新粉咨询数不能为空',                                    
386
+            'fan_add.required'           => '加粉数不能为空',                                    
387
+            'dtime.required'           => '日期不能为空',                                    
388
+        ]);
389
+        //数据库-新增数据
390
+        $custreport = array();       
391
+        $custreport['old_consult'] = $request->input('old_consult'); 
392
+        $custreport['new_consult'] = $request->input('new_consult'); 
393
+        $custreport['fan_add'] = $request->input('fan_add'); 
394
+        $custreport['dtime'] = $request->input('dtime');  
395
+
396
+        $id = (int)$request->input('id');
397
+        $res = DB::table('cust_day_detail')->where('id', $id)->update($custreport);        
398
+        return redirect('/admin/custreport/detailindex')->with('info', '更新成功');         
399
+    }
400
+
401
+    /**
402
+     * 分组管理-进行删除操作
403
+     * @param Request $request
404
+     * @return \Illuminate\Http\RedirectResponse
405
+     */
406
+    public function detaildelete($id)
407
+    {
408
+        $custreport = CustDetail::find($id);
409
+        $custreport->is_del = 1;
410
+        if ($custreport ->save()){
411
+            return redirect('/admin/custreport/detailindex')->with('info', '删除成功');
412
+        }
413
+    }
414
+
415
+    public function detail_export(Request $request){
416
+        
417
+        $self_role = session('role_name');
418
+        if($self_role == '超级管理员' || $self_role == '团队主管'){
419
+            $admin_id = $request->input('admin_id');
420
+        }else{
421
+            $admin_id = session('admin_id');
422
+        }
423
+        $stime = $request->input('stime');
424
+        $etime = $request->input('etime');
425
+
426
+        $result = CustDetail::where(function($query) use($admin_id, $stime, $etime){
427
+            if($admin_id) $query->where('admin_id',  $admin_id);
428
+            if($stime) $query->where('createTime', '>=', $stime);
429
+            if($etime) $query->where('createTime', '<=', $etime);
430
+        })->where('is_del',0)->orderBy('id', 'desc')->get();
431
+        $result = json_decode(json_encode($result),true);
432
+
433
+
434
+        $filename="粉丝数据分日统计.xls";
435
+        header("Content-type:application/vnd.ms-excel");
436
+        Header("Accept-Ranges:bytes");
437
+        Header("Content-Disposition:attachment;filename=".$filename); //$filename导出的文件名
438
+        header("Pragma: no-cache");
439
+        header("Expires: 0");
440
+
441
+        $data_str = "
442
+            <table>
443
+            <tr>
444
+                <th>".iconv("UTF-8", "GB2312//IGNORE","销售微信号")."</th>
445
+                <th>".iconv("UTF-8", "GB2312//IGNORE","销售团队")."</th>
446
+                <th>".iconv("UTF-8", "GB2312//IGNORE","销售")."</th>
447
+                <th>".iconv("UTF-8", "GB2312//IGNORE","订单时间")."</th>
448
+                <th>".iconv("UTF-8", "GB2312//IGNORE","加粉时间")."</th>
449
+                <th>".iconv("UTF-8", "GB2312//IGNORE","是否复购")."</th>
450
+                <th>".iconv("UTF-8", "GB2312//IGNORE","订单金额")."</th>
451
+                <th>".iconv("UTF-8", "GB2312//IGNORE","订单商品")."</th>
452
+                <th>".iconv("UTF-8", "GB2312//IGNORE","是否退补单")."</th>
453
+                <th>".iconv("UTF-8", "GB2312//IGNORE","配送地址")."</th>
454
+                <th>".iconv("UTF-8", "GB2312//IGNORE","配送姓名")."</th>
455
+                <th>".iconv("UTF-8", "GB2312//IGNORE","配送电话")."</th>
456
+                <th>".iconv("UTF-8", "GB2312//IGNORE","供应商成本")."</th>
457
+                <th>".iconv("UTF-8", "GB2312//IGNORE","顺丰单号")."</th>                
458
+
459
+            </tr>";
460
+            foreach ($result as $k => $v)
461
+            {
462
+                #销售
463
+                $admin = DB::table('admin')->where('id', $v['admin_id'])->first();
464
+                $v['wx_id'] = isset($admin->wx_id) ? $admin->wx_id : '';
465
+                #team
466
+                $team = DB::table('teams')->where('id', $v['team_id'])->first();
467
+                $v['team_name'] = isset($team->name) ? $team->name : '';
468
+                #加粉时间
469
+                $customr = DB::table('customers')->where('phone', $v['receiverMobile'])->first();
470
+                $v['fanTime'] = isset($customr->fanTime) ? $customr->fanTime : '';
471
+
472
+                $v['receiverMobile'] = substr($v['receiverMobile'], 0, 3).'****'.substr($v['receiverMobile'], 7);
473
+
474
+                $fugou = $v['is_fugou']==1? '是' : '否';
475
+                $is_refund = $v['is_refund']==1? '是' : '否';
476
+                $address = $v['receiverState'].$v['receiverCity'].$v['receiverDistrict'].$v['receiverAddress'];
477
+                $data_str .= "<tr>";
478
+                $data_str .= "<td>".$v['wx_id']."</td>";
479
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["team_name"])."</td>";
480
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["admin_name"])."</td>";
481
+                $data_str .= "<td>".$v['createTime']."</td>";
482
+                $data_str .= "<td>".$v['fanTime']."</td>";
483
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $fugou)."</td>";
484
+                $data_str .= "<td>".$v['receivedAmount']."</td>";
485
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["goods_note"])."</td>";
486
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $is_refund)."</td>";
487
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $address)."</td>";
488
+                $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["receiverName"])."</td>";
489
+                $data_str .= "<td>".$v['receiverMobile']."</td>";
490
+                $data_str .= "<td>".$v['cost']."</td>";
491
+                $data_str .= "<td style='vnd.ms-excel.numberformat:@'>".$v["logistics_id"]."</td>";
492
+                $data_str .= "</tr>";
493
+            }
494
+
495
+        $data_str .= "</table>";
496
+        echo $data_str;
497
+        exit;       
498
+    }
499
+}
500
+

+ 17 - 0
app/Http/routes.php

@@ -68,6 +68,23 @@ Route::group(['prefix' => 'admin'], function(){
68 68
         Route::get('/order/adminList', 'Admin\OrderController@adminList');
69 69
         Route::get('/order/categoods/{category}', 'Admin\OrderController@categoods');
70 70
         Route::get('/order/teamAdmins/{team_id}', 'Admin\OrderController@teamAdmins');
71
+
72
+        //数据报表
73
+        Route::get('/custreport/detailindex', 'Admin\CustReportController@detailindex');
74
+        Route::get('/custreport/detail_export', 'Admin\CustReportController@detail_export');
75
+        Route::get('/custreport/detailcreate', 'Admin\CustReportController@detailcreate');
76
+        Route::post('/custreport/detailstore', 'Admin\CustReportController@detailstore');
77
+        Route::get('/custreport/detailedit/{id}', 'Admin\CustReportController@detailedit');
78
+        Route::post('/custreport/detailupdate', 'Admin\CustReportController@detailupdate');
79
+        Route::get('/custreport/detaildelete/{id}', 'Admin\CustReportController@detaildelete');
80
+
81
+        Route::get('/custreport/totalindex', 'Admin\CustReportController@totalindex');
82
+        Route::get('/custreport/total_export', 'Admin\CustReportController@total_export');
83
+        Route::get('/custreport/totalcreate', 'Admin\CustReportController@totalcreate');
84
+        Route::post('/custreport/totalstore', 'Admin\CustReportController@totalstore');
85
+        Route::get('/custreport/totaledit/{id}', 'Admin\CustReportController@totaledit');
86
+        Route::post('/custreport/totalupdate', 'Admin\CustReportController@totalupdate');
87
+        Route::get('/custreport/totaldelete/{id}', 'Admin\CustReportController@totaldelete');
71 88
         
72 89
     });
73 90
     

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

@@ -61,6 +61,18 @@
61 61
                     </ul>
62 62
                 </dd>
63 63
             </dl>
64
+
65
+            <dl id="menu-order">
66
+                <dt @if(!isset($res['order/manage'])) style="display:none;list-style-type:none;" @endif><i class="Hui-iconfont">&#xe627;</i> 报表管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
67
+                <dd>
68
+                    <ul>                       
69
+                        <li @if(!isset($res['order/manage'])) style="display:none;list-style-type:none;" @endif><a data-href="{{url('admin/custreport/totalindex')}}" data-title="每日数据总概" href="javascript:void(0)">每日数据总概</a></li>                        
70
+                    </ul>
71
+                    <ul>                       
72
+                        <li @if(!isset($res['order/manage'])) style="display:none;list-style-type:none;" @endif><a data-href="{{url('admin/custreport/detailindex')}}" data-title="分销售每日数据统计" href="javascript:void(0)">分销售每日数据统计</a></li>                        
73
+                    </ul>
74
+                </dd>
75
+            </dl>
64 76
                      
65 77
 
66 78
         </div>

+ 77 - 0
resources/views/custreport/detailcreate.blade.php

@@ -0,0 +1,77 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(count($errors) > 0)
5
+        <div class="Huialert Huialert-info" id="error">
6
+            @foreach($errors->all() as $error)
7
+                <li>{{$error}}</li>
8
+            @endforeach
9
+        </div>
10
+    @endif
11
+    <div class="page-container">
12
+        <form action="/admin/custreport/detailstore" method="post" class="form form-horizontal" enctype="multipart/form-data">
13
+            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
14
+            
15
+            <div class="row cl">
16
+                <label class="form-label col-xs-4 col-sm-2">
17
+                    加粉数:</label>
18
+                <div class="formControls col-xs-6 col-sm-6">
19
+                    <input type="text" class="input-text" value="{{old('fan_add')}}" placeholder="请输入加粉数" name="fan_add">
20
+                </div>
21
+            </div>
22
+            
23
+            
24
+            <div class="row cl">
25
+                <label class="form-label col-xs-4 col-sm-2">
26
+                    老粉咨询数:</label>
27
+                <div class="formControls col-xs-6 col-sm-6">
28
+                    <input type="text" class="input-text" value="{{old('old_consult')}}" placeholder="" name="old_consult">
29
+                </div>
30
+            </div>
31
+
32
+            <div class="row cl">
33
+                <label class="form-label col-xs-4 col-sm-2">
34
+                    新粉咨询数:</label>
35
+                <div class="formControls col-xs-6 col-sm-6">
36
+                    <input type="text" class="input-text" value="{{old('new_consult')}}" placeholder="" name="new_consult">
37
+                </div>
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
+                    <input id="dtime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:22%;text-align:center;" name="dtime" value="">                    
45
+                </div>
46
+            </div>
47
+        
48
+            <div class="row cl">
49
+                <div class="col-9 col-offset-2">
50
+                    <button class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>&nbsp;
51
+                    <button class="btn btn-default" type="reset" onclick="return_index();">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>&nbsp;
52
+                </div>
53
+            </div>
54
+        </form>
55
+    </div>
56
+    <!--_footer 作为公共模版分离出去-->
57
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
58
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
59
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
60
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
61
+    <!--/_footer 作为公共模版分离出去-->
62
+
63
+    <!--请在下方写此页面业务相关的脚本-->
64
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
65
+    <script type="text/javascript">
66
+        $(function(){
67
+            setTimeout("$('#error').hide()",3000);            
68
+        });
69
+        /*返回*/
70
+        function return_index(){
71
+            location.href='/admin/custreport/detailindex';
72
+        }
73
+
74
+
75
+    </script>
76
+    </body>
77
+@endsection

+ 79 - 0
resources/views/custreport/detailedit.blade.php

@@ -0,0 +1,79 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(count($errors) > 0)
5
+        <div class="Huialert Huialert-info" id="error">
6
+            @foreach($errors->all() as $error)
7
+                <li>{{$error}}</li>
8
+            @endforeach
9
+        </div>
10
+    @endif
11
+    <div class="page-container">
12
+        <form action="/admin/custreport/detailupdate" method="post" class="form form-horizontal" enctype="multipart/form-data">
13
+            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
14
+
15
+            @if($custreport)
16
+            <input type="hidden" name="id" value="{{$custreport['id']}}" />
17
+            <div class="row cl">
18
+                <label class="form-label col-xs-4 col-sm-2">
19
+                    加粉数:</label>
20
+                <div class="formControls col-xs-6 col-sm-6">
21
+                    <input type="text" class="input-text" value="{{$custreport['fan_add']}}" placeholder="请输入加粉数" name="fan_add">
22
+                </div>
23
+            </div>
24
+            
25
+            
26
+            <div class="row cl">
27
+                <label class="form-label col-xs-4 col-sm-2">
28
+                    老粉咨询数:</label>
29
+                <div class="formControls col-xs-6 col-sm-6">
30
+                    <input type="text" class="input-text" value="{{$custreport['old_consult']}}" placeholder="" name="old_consult">
31
+                </div>
32
+            </div>
33
+
34
+            <div class="row cl">
35
+                <label class="form-label col-xs-4 col-sm-2">
36
+                    新粉咨询数:</label>
37
+                <div class="formControls col-xs-6 col-sm-6">
38
+                    <input type="text" class="input-text" value="{{$custreport['new_consult']}}" placeholder="" name="new_consult">
39
+                </div>
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
+                    <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']}}">                    
47
+                </div>
48
+            </div>
49
+               
50
+            @endif
51
+
52
+            <div class="row cl">
53
+                <div class="col-9 col-offset-2">
54
+                    <button class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>&nbsp;
55
+                    <button class="btn btn-default" type="reset" onclick="return_index();">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>&nbsp;
56
+                </div>
57
+            </div>
58
+        </form>
59
+    </div>
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
+    <!--/_footer 作为公共模版分离出去-->
66
+
67
+    <!--请在下方写此页面业务相关的脚本-->
68
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
69
+    <script type="text/javascript">
70
+        $(function(){
71
+            setTimeout("$('#error').hide()",3000);
72
+        });
73
+        /*返回*/
74
+        function return_index(){
75
+            location.href='/admin/custreport/detailindex';
76
+        }
77
+    </script>
78
+    </body>
79
+@endsection

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

@@ -0,0 +1,132 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    <div class="page-container">
5
+        <div>
6
+            <div>
7
+                <a class="btn btn-primary radius" onclick="custreport_add('新增', 0)" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 新增数据</a>
8
+                @if($search_admin == 1)
9
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="所属销售"/>
10
+                <select style="width:10%;text-align:center" id='admin_id' name="admin_id">
11
+                    <option value="0" @if($admin_id=='') selected @endif>-- 选择销售 --</option>
12
+                    @foreach($adminlist as $v)
13
+                        <option value="{{$v['id']}}" @if($admin_id==$v['id']) selected @endif>{{$v['realname']}}</option>
14
+                    @endforeach
15
+                </select>  
16
+                @endif              
17
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>
18
+                <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:''}}">
19
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="结束时间"/>
20
+                <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:''}}">
21
+               
22
+                
23
+                    <a style="margin-left: 5px" class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
24
+                    <!--a class="btn btn-primary radius" onclick="custreport_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出订单</a-->
25
+                
26
+            </div>
27
+        </div>
28
+        
29
+        <div class="mt-20">
30
+            <table class="table table-bcustreport table-bcustreported table-bg table-hover table-sort">
31
+                <thead>
32
+                <tr class="text-c">
33
+                    <th width="8%">日期</th>
34
+                    <th width="8%">加粉数</th>
35
+                    <th width="8%">老粉咨询数</th>
36
+                    <th width="8%">新粉咨询数</th>
37
+                    <th width="8%">所属销售</th>                                  
38
+                    <th width="6%">操作</th>                  
39
+                </tr>
40
+                </thead>
41
+                <tbody>
42
+                @if($result)
43
+                    @foreach($result as $a)
44
+                        <tr class="text-c" style=" text-align:center;">                           
45
+                            <td>{{$a['dtime']}}</td>                            
46
+                            <td>{{$a['fan_add']}}</td>                            
47
+                            <td>{{$a['old_consult']}}</td>                            
48
+                            <td>{{$a['new_consult']}}</td>                            
49
+                            <td>{{$a['admin_name']}}</td>                                                                                                          
50
+                            <td>
51
+                                <a style="text-decoration:none" onClick='custreport_edit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>
52
+                                <a style="text-decoration:none" onClick='custreport_del("删除","{{$a['id']}}")' href="javascript:;" title="删除"><span class="btn btn-primary radius">删除</span></a>
53
+                            </td>                             
54
+                        </tr>
55
+                    @endforeach
56
+                @endif
57
+                </tbody>
58
+            </table>
59
+        </div>
60
+        <div id="page" class="page_div"></div>
61
+    </div>
62
+    
63
+    <!--_footer 作为公共模版分离出去-->
64
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
65
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
66
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
67
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
68
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
69
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
70
+    <!--/_footer 作为公共模版分离出去-->
71
+    <!--/_footer 作为公共模版分离出去-->
72
+     <script type="text/javascript">
73
+        /*广告-添加*/
74
+        function custreport_add(title){
75
+            location.href="/admin/custreport/detailcreate";
76
+        }
77
+        /*广告-编辑*/
78
+        function custreport_edit(title,id){
79
+            location.href="/admin/custreport/detailedit/"+id;
80
+        }
81
+        /*广告-设为首页显示*/
82
+        function up(obj,id){
83
+            layer.confirm('确认要设为首页显示吗?',function(index){
84
+                location.href='/admin/custreport/up/'+id;
85
+            });
86
+        }
87
+        /*广告-移除*/
88
+        function custreport_del(obj,id){
89
+            layer.confirm('确认要删除吗?',function(index){
90
+                location.href='/admin/custreport/detaildelete/'+id;
91
+            });
92
+        }
93
+        /*广告-设为首页隐藏*/
94
+        function down(obj,id){
95
+            layer.confirm('确认要设为首页隐藏吗?',function(index){
96
+                location.href='/admin/custreport/down/'+id;
97
+            });
98
+        }
99
+        function user_search(){
100
+            var admin_id = $('#admin_id').val();
101
+            var stime = $('#stime').val();
102
+            var etime = $('#etime').val();
103
+            var page = {{$page}};
104
+            location.href = 'detailindex?page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime;
105
+        }
106
+        //导出
107
+        function custreport_export(){
108
+            var admin_id = $('#admin_id').val();
109
+            var stime = $('#stime').val();
110
+            var etime = $('#etime').val();
111
+            location.href = '/admin/custreport/detail_export?admin_id='+admin_id+'&stime='+stime+'&etime='+etime;
112
+        }
113
+       
114
+        /*分页*/
115
+        
116
+        $("#page").paging({
117
+            pageNo:{{$page}},
118
+            totalPage: {{$pages}},
119
+            totalSize: {{$count}},
120
+            callback: function(num) {
121
+                var admin_id = $('#admin_id').val();
122
+                var stime = $('#stime').val();
123
+                var etime = $('#etime').val();
124
+                location.href='detailindex?page='+num+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime;
125
+            }
126
+        })
127
+        
128
+    </script>
129
+   
130
+    </body>
131
+
132
+@endsection

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

@@ -0,0 +1,69 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(count($errors) > 0)
5
+        <div class="Huialert Huialert-info" id="error">
6
+            @foreach($errors->all() as $error)
7
+                <li>{{$error}}</li>
8
+            @endforeach
9
+        </div>
10
+    @endif
11
+    <div class="page-container">
12
+        <form action="/admin/custreport/totalstore" method="post" class="form form-horizontal" enctype="multipart/form-data">
13
+            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
14
+            
15
+            <div class="row cl">
16
+                <label class="form-label col-xs-4 col-sm-2">
17
+                    总加粉数:</label>
18
+                <div class="formControls col-xs-6 col-sm-6">
19
+                    <input type="text" class="input-text" value="{{old('total_fan_add')}}" placeholder="请输入加粉数" name="total_fan_add">
20
+                </div>
21
+            </div>
22
+            
23
+            
24
+            <div class="row cl">
25
+                <label class="form-label col-xs-4 col-sm-2">
26
+                    总投入成本:</label>
27
+                <div class="formControls col-xs-6 col-sm-6">
28
+                    <input type="text" class="input-text" value="{{old('total_cost')}}" placeholder="" name="total_cost">
29
+                </div>
30
+            </div>
31
+
32
+            <div class="row cl">
33
+                <label class="form-label col-xs-4 col-sm-2">
34
+                    日期:</label>
35
+                <div class="formControls col-xs-6 col-sm-6">
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
+                </div>
38
+            </div>
39
+        
40
+            <div class="row cl">
41
+                <div class="col-9 col-offset-2">
42
+                    <button class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>&nbsp;
43
+                    <button class="btn btn-default" type="reset" onclick="return_index();">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>&nbsp;
44
+                </div>
45
+            </div>
46
+        </form>
47
+    </div>
48
+    <!--_footer 作为公共模版分离出去-->
49
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
50
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
51
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
52
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
53
+    <!--/_footer 作为公共模版分离出去-->
54
+
55
+    <!--请在下方写此页面业务相关的脚本-->
56
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
57
+    <script type="text/javascript">
58
+        $(function(){
59
+            setTimeout("$('#error').hide()",3000);            
60
+        });
61
+        /*返回*/
62
+        function return_index(){
63
+            location.href='/admin/custreport/totalindex';
64
+        }
65
+
66
+
67
+    </script>
68
+    </body>
69
+@endsection

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

@@ -0,0 +1,71 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(count($errors) > 0)
5
+        <div class="Huialert Huialert-info" id="error">
6
+            @foreach($errors->all() as $error)
7
+                <li>{{$error}}</li>
8
+            @endforeach
9
+        </div>
10
+    @endif
11
+    <div class="page-container">
12
+        <form action="/admin/custreport/totalupdate" method="post" class="form form-horizontal" enctype="multipart/form-data">
13
+            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
14
+
15
+            @if($custreport)
16
+            <input type="hidden" name="id" value="{{$custreport['id']}}" />
17
+            <div class="row cl">
18
+                <label class="form-label col-xs-4 col-sm-2">
19
+                    总加粉数:</label>
20
+                <div class="formControls col-xs-6 col-sm-6">
21
+                    <input type="text" class="input-text" value="{{$custreport['total_fan_add']}}" placeholder="请输入加粉数" name="total_fan_add">
22
+                </div>
23
+            </div>
24
+            
25
+            
26
+            <div class="row cl">
27
+                <label class="form-label col-xs-4 col-sm-2">
28
+                    总投入成本:</label>
29
+                <div class="formControls col-xs-6 col-sm-6">
30
+                    <input type="text" class="input-text" value="{{$custreport['total_cost']}}" placeholder="" name="total_cost">
31
+                </div>
32
+            </div>
33
+
34
+            <div class="row cl">
35
+                <label class="form-label col-xs-4 col-sm-2">
36
+                    日期:</label>
37
+                <div class="formControls col-xs-6 col-sm-6">
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
+                </div>
40
+            </div>
41
+               
42
+            @endif
43
+
44
+            <div class="row cl">
45
+                <div class="col-9 col-offset-2">
46
+                    <button class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>&nbsp;
47
+                    <button class="btn btn-default" type="reset" onclick="return_index();">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>&nbsp;
48
+                </div>
49
+            </div>
50
+        </form>
51
+    </div>
52
+    <!--_footer 作为公共模版分离出去-->
53
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
54
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
55
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
56
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
57
+    <!--/_footer 作为公共模版分离出去-->
58
+
59
+    <!--请在下方写此页面业务相关的脚本-->
60
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
61
+    <script type="text/javascript">
62
+        $(function(){
63
+            setTimeout("$('#error').hide()",3000);
64
+        });
65
+        /*返回*/
66
+        function return_index(){
67
+            location.href='/admin/custreport/totalindex';
68
+        }
69
+    </script>
70
+    </body>
71
+@endsection

+ 117 - 0
resources/views/custreport/totallist.blade.php

@@ -0,0 +1,117 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    <div class="page-container">
5
+        <div>
6
+            <div>
7
+                <a class="btn btn-primary radius" onclick="custreport_add('新增', 0)" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 新增数据</a>
8
+                             
9
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>
10
+                <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
+                <input class="input-text" style="width:6%;text-align:center" type="text" value="结束时间"/>
12
+                <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:''}}">
13
+               
14
+                
15
+                <a class="btn btn-primary radius"  style="margin-left: 5px" onclick="user_search()" href="javascript:;">搜索</a>
16
+                    <!--a class="btn btn-primary radius" onclick="custreport_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出数据</a-->
17
+                
18
+            </div>
19
+        </div>
20
+        
21
+        <div class="mt-20">
22
+            <table class="table table-bcustreport table-bcustreported table-bg table-hover table-sort">
23
+                <thead>
24
+                <tr class="text-c">
25
+                    <th width="8%">日期</th>
26
+                    <th width="8%">总加粉数</th>
27
+                    <th width="8%">总成本</th>                                 
28
+                    <th width="6%">操作</th>                  
29
+                </tr>
30
+                </thead>
31
+                <tbody>
32
+                @if($result)
33
+                    @foreach($result as $a)
34
+                        <tr class="text-c" style=" text-align:center;">                           
35
+                            <td>{{$a['dtime']}}</td>                            
36
+                            <td>{{$a['total_fan_add']}}</td>                            
37
+                            <td>{{$a['total_cost']}}</td>                                                                                                                                     
38
+                            <td>
39
+                                <a style="text-decoration:none" onClick='custreport_edit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>
40
+                                <a style="text-decoration:none" onClick='custreport_del("删除","{{$a['id']}}")' href="javascript:;" title="删除"><span class="btn btn-primary radius">删除</span></a>
41
+                            </td>                             
42
+                        </tr>
43
+                    @endforeach
44
+                @endif
45
+                </tbody>
46
+            </table>
47
+        </div>
48
+        <div id="page" class="page_div"></div>
49
+    </div>
50
+    
51
+    <!--_footer 作为公共模版分离出去-->
52
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
53
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
54
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
55
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
56
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
57
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
58
+    <!--/_footer 作为公共模版分离出去-->
59
+    <!--/_footer 作为公共模版分离出去-->
60
+     <script type="text/javascript">
61
+        /*广告-添加*/
62
+        function custreport_add(title){
63
+            location.href="/admin/custreport/totalcreate";
64
+        }
65
+        /*广告-编辑*/
66
+        function custreport_edit(title,id){
67
+            location.href="/admin/custreport/totaledit/"+id;
68
+        }
69
+        /*广告-设为首页显示*/
70
+        function up(obj,id){
71
+            layer.confirm('确认要设为首页显示吗?',function(index){
72
+                location.href='/admin/custreport/up/'+id;
73
+            });
74
+        }
75
+        /*广告-移除*/
76
+        function custreport_del(obj,id){
77
+            layer.confirm('确认要删除吗?',function(index){
78
+                location.href='/admin/custreport/totaldelete/'+id;
79
+            });
80
+        }
81
+        /*广告-设为首页隐藏*/
82
+        function down(obj,id){
83
+            layer.confirm('确认要设为首页隐藏吗?',function(index){
84
+                location.href='/admin/custreport/down/'+id;
85
+            });
86
+        }
87
+        function user_search(){
88
+            var stime = $('#stime').val();
89
+            var etime = $('#etime').val();
90
+            var page = {{$page}};
91
+            location.href = 'totalindex?page='+page+'&stime='+stime+'&etime='+etime;
92
+        }
93
+        //导出
94
+        function custreport_export(){
95
+            var stime = $('#stime').val();
96
+            var etime = $('#etime').val();
97
+            location.href = '/admin/custreport/total_export?stime='+stime+'&etime='+etime;
98
+        }
99
+       
100
+        /*分页*/
101
+        
102
+        $("#page").paging({
103
+            pageNo:{{$page}},
104
+            totalPage: {{$pages}},
105
+            totalSize: {{$count}},
106
+            callback: function(num) {
107
+                var stime = $('#stime').val();
108
+                var etime = $('#etime').val();
109
+                location.href='totalindex?page='+num+'&stime='+stime+'&etime='+etime;
110
+            }
111
+        })
112
+        
113
+    </script>
114
+   
115
+    </body>
116
+
117
+@endsection