ソースを参照

爬取卖家云订单脚本以及用户订单统计

shensong 5 年 前
コミット
b6bb2f4b58

+ 73 - 0
app/Console/Commands/CustomerOrder.php

@@ -0,0 +1,73 @@
1
+<?php namespace App\Console\Commands;
2
+
3
+use App\Customer;
4
+use App\CustomerOrderDay;
5
+use App\Order;
6
+use Illuminate\Console\Command;
7
+use Illuminate\Support\Facades\DB;
8
+use Symfony\Component\Console\Input\InputOption;
9
+use Symfony\Component\Console\Input\InputArgument;
10
+
11
+class CustomerOrder extends Command {
12
+
13
+	protected $name = 'CustomerOrder';
14
+	protected $description = '统计用户订单';
15
+	protected $page = 1;
16
+	protected $limit = 10;
17
+
18
+    public function handle() {
19
+        try{
20
+            $this->getCustomerList();
21
+        } catch (\Exception $e) {
22
+            echo $e->getMessage();
23
+        }
24
+
25
+    }
26
+
27
+    public function getCustomerList() {
28
+        $page = $this->page;
29
+        $offset = ($page - 1) * $this->limit;
30
+
31
+        //分页获取用户列表数据
32
+        $list = Customer::select('id','phone','name','fanTime')->offset($offset)->limit($this->limit)->get();
33
+        $list = json_decode(json_encode($list),true);
34
+        if(count($list) > 0){
35
+            $this->page++;
36
+            $this->updateOrInsert($list);
37
+            $this->getCustomerList();
38
+        } else {
39
+            echo 'SUCCESS';die;
40
+        }
41
+
42
+    }
43
+
44
+    public function updateOrInsert ( $data ) {
45
+        foreach ( $data as $value ) {
46
+            //遍历用户 统计每个用户的订单情况
47
+            $order = Order::select(DB::raw('count(1) as num,
48
+	SUM(receivedAmount) AS totalReceiveAmount,
49
+	SUM(freight_cost) AS totalFreightCost,
50
+	SUM(aftersale_fee) as totalAftersaleFee,
51
+	SUM(refund_price) AS totalRefundPrice,
52
+	SUM(cost) as totalCost'))->where('receiverMobile',$value['phone'])->where('is_del',0)->first();
53
+            $params['totalReceivedAmount'] = $order->totalReceiveAmount;
54
+            $params['totalOrderNumber'] = $order->num;
55
+            $params['totalCost'] = $order->totalCost;
56
+            $params['totalRefundPrice'] = $order->totalRefundPrice;
57
+            $params['totalFreightCost'] = $order->totalFreightCost;
58
+            $params['totalAftersaleFee'] = $order->totalAftersaleFee;
59
+            $params['grossProfit'] = ($params['totalReceivedAmount'] + $params['totalRefundPrice']) - ($params['totalCost'] + $params['totalFreightCost'] + $params['totalAftersaleFee']);
60
+            $params['grossProfitRatio'] = $params['totalReceivedAmount'] == 0 ? 0 : ($params['grossProfit'] / $params['totalReceivedAmount']);
61
+            $res = CustomerOrderDay::where('customer_id',$value['id'])->first();
62
+            if($res){
63
+                CustomerOrderDay::where('customer_id',$value['id'])->update($params);
64
+            } else {
65
+                $params['customer_id'] = $value['id'];
66
+                $params['name'] = $value['name'];
67
+                $params['phone'] = $value['phone'];
68
+                $params['fanTime'] = $value['fanTime'];
69
+                CustomerOrderDay::insert($params);
70
+            }
71
+        }
72
+    }
73
+}

+ 256 - 0
app/Console/Commands/freightCost.php

@@ -0,0 +1,256 @@
1
+<?php namespace App\Console\Commands;
2
+
3
+use App\Order;
4
+use Illuminate\Console\Command;
5
+use Symfony\Component\Console\Input\InputOption;
6
+use Symfony\Component\Console\Input\InputArgument;
7
+
8
+class freightCost extends Command {
9
+
10
+    protected $signature = 'FreightCost';
11
+
12
+    /**
13
+     * The console command description.
14
+     *
15
+     * @var string
16
+     */
17
+    protected $description = '更新发货订单运费成本';
18
+//    protected $script = 1;
19
+    protected $apiKey = 'CZx9Ft8GNnV3MO03pqmr7Ghg';
20
+    protected $secretKey = '1iunpfvhk6PAyxqjKOne4drfjDzyPtef';
21
+    protected $accessToken = '';//百度OCR
22
+    protected $page = 1;//当前页
23
+    protected $pages = 1;//总页码
24
+    protected $HTSESSIONID = 'HTSESSIONKEY-1573625655752481066088685965324';
25
+    protected $phone = '15120071946';//卖家云账号
26
+    protected $password = 'Kuxuan1!';//卖家云密码
27
+
28
+
29
+    public function handle() {
30
+//        $this->script = $this->argument('script');
31
+        set_time_limit(0);
32
+        ini_set('memory_limit', '1024M');
33
+//        if(1 == $this->script){
34
+//            $this->getSession();
35
+//        } else if(2 == $this->script){
36
+            $this->getFreightCost();
37
+//        }
38
+    }
39
+
40
+    public function getSession() {
41
+        //获取图片验证码
42
+        $imgArr = $this->getImage();
43
+        //百度OCR图片识别
44
+        $code = $this->getCode($imgArr['captchBase64Image']);
45
+        //登录接口并获取cookie当中的HTSESSIONID
46
+        $this->login($code,$imgArr['captchaIndex']);
47
+        //登录后查询发货订单列表
48
+        $this->getFreightCost();
49
+    }
50
+
51
+    //获取卖家云图片验证码
52
+    public function getImage() {
53
+        $url = 'http://erp.maijiayun.cn/captcha20/refreshCaptcha/null.ht';
54
+        $method = 'get';
55
+
56
+        $result = $this->curlWithIpPorxy($method,$url);
57
+        if($result['success']){
58
+            return $result['data'];
59
+        } else {
60
+            return false;
61
+        }
62
+    }
63
+
64
+    //获取百度OCR access_token
65
+    public function getAccessToken() {
66
+        $url = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=CZx9Ft8GNnV3MO03pqmr7Ghg&client_secret=1iunpfvhk6PAyxqjKOne4drfjDzyPtef&';
67
+        $res = file_get_contents($url);
68
+        $res = json_decode($res,true);
69
+        $this->accessToken = $res['access_token'];
70
+    }
71
+
72
+    //百度OCR 识别图片并返回验证码
73
+    public function getCode($imgStr) {
74
+        $this->getAccessToken();
75
+        $header = array(
76
+            'Content-Type: application/x-www-form-urlencoded',
77
+        );
78
+        $method = 'post';
79
+        $url = 'https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token='.$this->accessToken;
80
+        $imgArr = explode(',',$imgStr);
81
+        $params = array(
82
+            'image' => $imgArr[1]
83
+        );
84
+
85
+        $res = $this->curlWithIpPorxy($method,$url,$params,$header);
86
+        return $res['words_result'][0]['words'];
87
+    }
88
+
89
+    //卖家云登录接口获取HTSESSIONID
90
+    public function login($imgCaptcha,$imgCaptchaKey) {
91
+        $url = 'http://erp.maijiayun.cn/login.ht';
92
+        $method = 'post';
93
+        $params['identifier'] = $this->phone;
94
+        $params['type'] = 'sms';
95
+        $params['password'] = md5($this->password);
96
+        $params['imgCaptchaKey'] = $imgCaptchaKey;
97
+        $params['imgCaptcha'] = $imgCaptcha;
98
+        $params['eid'] = 'RLMHCBEVA65INDEQ675TEJBW54PQHGD6A62PW2L7G2QZEPVNR5MNRVUVNPMKUOXBCQOOJV4CUWH26XU3L77NFNIB4U';
99
+        $params['ati'] = '1543460228652';
100
+
101
+        $header = array(
102
+            'Content-Type:application/x-www-form-urlencoded; charset=UTF-8',
103
+        );
104
+        $res = $this->curlWithIpPorxy2($method,$url,$params,$header);
105
+    }
106
+
107
+    //根据日期获取发货订单列表
108
+    public function getFreightCost($times = 0) {
109
+        $url = 'http://erp.maijiayun.cn/dd/print/statistics/list/deliver.ht';
110
+        $method = 'post';
111
+//        $startDate = '2019-10-15 00:00:00';
112
+        $startDate = date('Y-m-d 00:00:00',strtotime('-5 days'));
113
+        $endDate = date('Y-m-d 23:59:59',time());
114
+
115
+        $params = array(
116
+            'andQuery'=>'[{"type":"NotEqualCondition","column":"expressCode","value":""},
117
+            {"type":"GreaterEqualCondition","column":"deliveryTime","value":"'.$startDate.'"},
118
+            {"type":"LessEqualCondition","column":"deliveryTime","value":"'.$endDate.'"}]',
119
+            'endTime'=>$endDate,
120
+            'startTime'=>$startDate,
121
+            'sort_by'=>'deliveryTime',
122
+            'per_page'=>'10',
123
+            'page'=>$this->page,
124
+            'order'=>'desc',
125
+        );
126
+        $header = array(
127
+            'Content-Type:application/json',
128
+        );
129
+        $cookie = 'HTSESSIONID='.$this->HTSESSIONID;
130
+        $res = $this->curlWithIpPorxy($method,$url,$params,$header,0,'json',$cookie);
131
+
132
+        //cookie过期 重新登录
133
+        if(isset($res['type']) && 'MJYLoginException' == $res['type']){
134
+            $this->getSession();
135
+        }
136
+
137
+        //失败次数超过3次自动停止
138
+        if($times >= 3){
139
+            print_r($res);
140
+            echo 'FAIL';die;
141
+        }
142
+
143
+        //没有返回正确数据格式 重新请求一次
144
+        if(!isset($res['totalPageNum'])){
145
+            $times++;
146
+            $this->getFreightCost($times);
147
+        }
148
+        $this->pages = $res['totalPageNum'];
149
+
150
+        //更新订单运费
151
+        $this->updateFiveDaysOrder($res['page']);
152
+        if($this->page < $this->pages){
153
+            //继续请求下一页数据
154
+            $this->page++;
155
+            $this->getFreightCost();
156
+        } else {
157
+            die;
158
+        }
159
+    }
160
+
161
+    //更新近十日订单
162
+    public function updateFiveDaysOrder( $data ) {
163
+        foreach( $data as $value ) {
164
+            if( $value['logisticsCost'] > 0 ){
165
+                $freightCost = $value['logisticsCost'];
166
+                $re = Order::where('logistics_id',$value['expressCode'])->where('is_del',0)->where('warehouse',3)
167
+                    ->update(['freight_cost'=>$freightCost]);
168
+                echo $value['expressCode'].' ';
169
+            } else {
170
+                continue;
171
+            }
172
+        }
173
+    }
174
+
175
+    //获取接口返回数据
176
+    private function curlWithIpPorxy($method, $url, $data = array(), $headers = false, $times = 0, $datatype = 'form-data',$cookie = false) {
177
+        $times++;
178
+        $ch = curl_init(); //初始化curl
179
+//        curl_setopt($ch, CURLOPT_COOKIEJAR, storage_path()."/logs/cookie_jar.txt");
180
+        curl_setopt($ch, CURLOPT_URL, $url);
181
+        curl_setopt($ch, CURLOPT_HEADER, 0); //
182
+        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
183
+        if($headers){
184
+            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
185
+        }
186
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //要求结果为字符串且输出到屏幕上
187
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //绕过ssl验证
188
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
189
+        if ($method == 'post') {
190
+            curl_setopt($ch, CURLOPT_POST, 1); //post提交方式
191
+            if ($datatype == 'form-data') {
192
+                curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
193
+            } else if ($datatype == 'json') {
194
+                curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
195
+            }
196
+        }
197
+        if ($cookie) {
198
+            curl_setopt($ch, CURLOPT_COOKIE, $cookie);
199
+        }
200
+
201
+        $result = curl_exec($ch); //运行curl
202
+        if ($result === false && $times < 4) { //接口超时
203
+            return self::curlWithIpPorxy($method, $url, $data, $headers, $times);
204
+        }
205
+        if ($result === false) {
206
+            return $result;
207
+        }
208
+        return json_decode($result, true);
209
+    }
210
+
211
+    //需要获取返回的response body中的cookie值
212
+    private function curlWithIpPorxy2($method, $url, $data = array(), $headers = false, $times = 0, $datatype = 'form-data') {
213
+        $times++;
214
+        $ch = curl_init(); //初始化curl
215
+//        curl_setopt($ch, CURLOPT_COOKIEJAR, storage_path()."/logs/cookie_jar.txt");
216
+        curl_setopt($ch, CURLOPT_URL, $url);
217
+        curl_setopt($ch, CURLOPT_HEADER, 1); //
218
+        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
219
+        if($headers){
220
+            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
221
+        }
222
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //要求结果为字符串且输出到屏幕上
223
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //绕过ssl验证
224
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
225
+        if ($method == 'post') {
226
+            curl_setopt($ch, CURLOPT_POST, 1); //post提交方式
227
+            if ($datatype == 'form-data') {
228
+                curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
229
+            } else if ($datatype == 'json') {
230
+                curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
231
+            }
232
+        }
233
+
234
+        $result = curl_exec($ch); //运行curl
235
+        if ($result === false && $times < 4) { //接口超时
236
+            return $this->curlWithIpPorxy($method, $url, $data, $headers, $times);
237
+        }
238
+        if ($result === false) {
239
+            return $result;
240
+        }
241
+        // 解析HTTP数据流
242
+        if(preg_match('/Set-Cookie:[\s]+([^=]+)=([^;]+)/i', $result,$match)) {
243
+            $cookies[$match[1]] = $match[2];
244
+            $this->HTSESSIONID = $cookies['HTSESSIONID'];
245
+            print_r($cookies['HTSESSIONID']);
246
+            return $cookies['HTSESSIONID'];
247
+//            foreach ($cookies as $cookieKey => $cookieVal ) {
248
+//                setcookie($cookieKey,$cookieVal);
249
+//            }
250
+        } else {
251
+            return $this->curlWithIpPorxy($method, $url, $data, $headers, $times);
252
+        }
253
+//        return json_decode($result, true);
254
+    }
255
+
256
+}

+ 2 - 2
app/Console/Kernel.php

@@ -42,8 +42,8 @@ class Kernel extends ConsoleKernel {
42 42
         'App\Console\Commands\RoiTeamTotal',
43 43
         'App\Console\Commands\DayGrandTeamTotal',
44 44
         'App\Console\Commands\DayGrandTeamTotalHistory',
45
-
46
-        
45
+        'App\Console\Commands\freightCost',
46
+        'App\Console\Commands\CustomerOrder',
47 47
     ];
48 48
 
49 49
 	/**

+ 18 - 0
app/Customer.php

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

+ 18 - 0
app/CustomerOrderDay.php

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

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

@@ -7,6 +7,7 @@
7 7
  */
8 8
 namespace App\Http\Controllers\Admin;
9 9
 
10
+use App\CustomerOrderDay;
10 11
 use App\Http\Controllers\Controller;
11 12
 use App\Logs;
12 13
 use App\CustTotal;
@@ -4911,6 +4912,50 @@ class StatisticsController extends Controller
4911 4912
         $filename = 'teamRoi_'.date('Y-m-d_H').'.xlsx';
4912 4913
         return Order::export_excel($result, $filename, $indexKey, $title); 
4913 4914
     }
4915
+
4916
+    public function customerOrder(Request $request) {
4917
+        $page = (int)$request->input('page');
4918
+        $pageSize = 20;
4919
+        if($page<=0){
4920
+            $page = 1;
4921
+        }
4922
+
4923
+        $offset = ($page-1) * $pageSize;
4924
+        $count = CustomerOrderDay::count();
4925
+        $data = CustomerOrderDay::offset($offset)->limit($pageSize)->get();
4926
+
4927
+        if ($count > 1) {
4928
+            // 总页数
4929
+            $pages = ceil($count/20);
4930
+        }else{
4931
+            // 总页数
4932
+            $pages = 1;
4933
+        }
4934
+
4935
+        $result = json_decode(json_encode($data),true);
4936
+        $result = array_map(function($value){
4937
+            $item = $value;
4938
+            $phone = $value['phone'];
4939
+            $item['phone'] = is_numeric($phone) ? substr_replace($phone, '****', 3, 4) : $phone;
4940
+            return $item;
4941
+        },$result);
4942
+        return view('statistics/customerOrder', ['result' =>$result,
4943
+            'page'              =>$page,
4944
+            'count'             =>$count,
4945
+            'pages'             =>$pages,
4946
+        ]);
4947
+    }
4948
+
4949
+    function findNum($str=''){
4950
+        $str=trim($str);
4951
+        if(empty($str)){return '';}
4952
+        $reg='/(\d{3}(\.\d+)?)/is';//匹配数字的正则表达式
4953
+        preg_match_all($reg,$str,$result);
4954
+        if(is_array($result)&&!empty($result)&&!empty($result[1])&&!empty($result[1][0])){
4955
+            return $result[1][0];
4956
+        }
4957
+        return '';
4958
+    }
4914 4959
                                                                                 
4915 4960
 }
4916 4961
                                                                           

+ 3 - 0
app/Http/routes.php

@@ -253,6 +253,9 @@ Route::group(['prefix' => 'admin'], function(){
253 253
         //获取余额
254 254
         Route::get('cust/getBalance/{phone}', 'Admin\CustomerDepositController@getBalance');
255 255
 
256
+        //用户订单统计
257
+        Route::get('statistics/customerOrder','Admin\StatisticsController@customerOrder');
258
+
256 259
     });
257 260
     
258 261
 });

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

@@ -153,6 +153,9 @@
153 153
 
154 154
                         <li @if(!isset($res['statistics/dayGrandTeamTotal'])) style="display:none;list-style-type:none;" @endif><a data-href="{{url('admin/statistics/dayGrandTeamTotal')}}" data-title="团队ROI每日汇总报表" href="javascript:void(0)">团队ROI每日汇总报表</a></li>
155 155
                     </ul>
156
+                    <ul>
157
+                        <li @if(!isset($res['statistics/customerOrder'])) style="display:none;list-style-type:none;" @endif><a data-href="{{url('admin/statistics/customerOrder')}}" data-title="用户订单统计" href="javascript:void(0)">用户订单统计</a></li>
158
+                    </ul>
156 159
                    
157 160
                 </dd>
158 161
             </dl>

+ 108 - 0
resources/views/statistics/customerOrder.blade.php

@@ -0,0 +1,108 @@
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
+                {{--<select style="width:10%;text-align:center" id='team_id' name="team_id">--}}
9
+                    {{--<option value="0" @if($team_id=='') selected @endif>-- 选择团队 --</option>--}}
10
+                    {{--@foreach($teamlist as $v)--}}
11
+                        {{--<option value="{{$v['id']}}" @if($team_id==$v['id']) selected @endif>{{$v['name']}}</option>--}}
12
+                    {{--@endforeach--}}
13
+                {{--</select>--}}
14
+
15
+                {{--<input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>--}}
16
+                {{--<input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" autocomplete="off" style="width:12%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">--}}
17
+                {{--<input class="input-text" style="width:6%;text-align:center" type="text" value="结束时间"/>--}}
18
+                {{--<input id="etime"type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" autocomplete="off" style="width:12%;text-align:center;margin-left: -5px" name="etime" value="{{$etime?$etime:''}}">--}}
19
+
20
+                {{--<a class="btn btn-primary radius"  style="margin-left: 5px" onclick="user_search()" href="javascript:;">搜索</a>--}}
21
+                {{--<a class="btn btn-primary radius" onclick="statistics_export()" href="javascript:;"><i class="Hui-iconfont"></i> 导出数据</a>--}}
22
+
23
+            {{--</div>--}}
24
+        {{--</div>--}}
25
+
26
+        <div class="mt-20">
27
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
28
+                <thead>
29
+                <tr class="text-c">
30
+                    <th width="4%">姓名</th>
31
+                    <th width="4%">手机号</th>
32
+                    <th width="4%">加粉时间</th>
33
+                    <th width="4%">成交总金额</th>
34
+                    <th width="4%">成交总单数</th>
35
+                    <th width="4%">退补总金额</th>
36
+                    <th width="4%">售后总金额</th>
37
+                    <th width="4%">成本总金额</th>
38
+                    <th width="4%">运费总金额</th>
39
+                    <th width="4%">毛利</th>
40
+                    <th width="4%">毛利占比</th>
41
+                </tr>
42
+                </thead>
43
+                <tbody>
44
+                @if($result)
45
+                    @foreach($result as $a)
46
+                        <tr class="text-c" style=" text-align:center;">
47
+                            <td>{{$a['name']}}</td>
48
+                            <td>{{$a['phone']}}</td>
49
+                            <td>{{$a['fanTime']}}</td>
50
+                            <td>{{$a['totalReceivedAmount']}}</td>
51
+                            <td>{{$a['totalOrderNumber']}}</td>
52
+                            <td>{{$a['totalRefundPrice']}}</td>
53
+                            <td>{{$a['totalAftersaleFee']}}</td>
54
+                            <td>{{$a['totalCost']}}</td>
55
+                            <td>{{$a['totalFreightCost']}}</td>
56
+                            <td>{{$a['grossProfit']}}</td>
57
+                            <td>{{$a['grossProfitRatio']}}</td>
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
+        // function user_search(){
78
+        //     var stime = $('#stime').val();
79
+        //     var etime = $('#etime').val();
80
+        //     var team_id = $('#team_id').val();
81
+        //
82
+        //     location.href = 'dayGrandTeamTotal?stime='+stime+'&etime='+etime+'&team_id='+team_id;
83
+        // }
84
+        // //导出
85
+        // function statistics_export(){
86
+        //     var stime = $('#stime').val();
87
+        //     var etime = $('#etime').val();
88
+        //     var team_id = $('#team_id').val();
89
+        //
90
+        //     location.href = '/admin/statistics/dayGrandTeamTotal_export?stime='+stime+'&etime='+etime+'&team_id='+team_id;
91
+        // }
92
+
93
+        /*分页*/
94
+
95
+        $("#page").paging({
96
+            pageNo:{{$page}},
97
+            totalPage: {{$pages}},
98
+            totalSize: {{$count}},
99
+            callback: function(num) {
100
+                location.href='customerOrder?page='+num;
101
+            }
102
+        })
103
+
104
+    </script>
105
+
106
+    </body>
107
+
108
+@endsection