Browse Source

解决冲突

sunhao 5 years ago
parent
commit
aeab477b05

+ 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
+}

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

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

+ 2 - 2
app/Console/Kernel.php

@@ -46,8 +46,8 @@ class Kernel extends ConsoleKernel {
46 46
         'App\Console\Commands\RoiSalerTotal',
47 47
         'App\Console\Commands\DayGrandSalerTotalHistory',
48 48
         'App\Console\Commands\DayGrandSalerTotal',
49
-
50
-        
49
+        'App\Console\Commands\freightCost',
50
+        'App\Console\Commands\CustomerOrder',
51 51
     ];
52 52
 
53 53
 	/**

+ 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