Browse Source

添加售后退补筛选条件

shensong00 5 years ago
parent
commit
ba1a44e26a

+ 6 - 2
app/Http/Controllers/Admin/OrderController.php

@@ -2579,14 +2579,16 @@ class OrderController extends Controller
2579 2579
         $name = $request->input('receiverName');
2580 2580
         $phone = $request->input('receiverMobile');
2581 2581
         $page = $request->input('page',1);
2582
+        $service_type = $request->input('service_type');
2582 2583
         $pageSize = 20;
2583 2584
         $offset = ($page - 1)*$pageSize;
2584 2585
 
2585 2586
         //总数据条数
2586
-        $count = DB::table('customer_service_after_sale_order')->where(function($query) use ($order_id, $name, $phone) {
2587
+        $count = DB::table('customer_service_after_sale_order')->where(function($query) use ($order_id, $name, $phone, $service_type) {
2587 2588
             if($order_id) $query->where('order_id',$order_id);
2588 2589
             if($name) $query->where('receiverName','like','%'.$name.'%');
2589 2590
             if($phone) $query->where('receiverMobile','like','%'.$phone.'%');
2591
+            if($service_type != 0) $query->where('service_type', $service_type);
2590 2592
         })->count();
2591 2593
 
2592 2594
         if ($count > 1) {
@@ -2597,10 +2599,11 @@ class OrderController extends Controller
2597 2599
             $pages = 1;
2598 2600
         }
2599 2601
 
2600
-        $result = DB::table('customer_service_after_sale_order')->where(function($query) use ($order_id, $name, $phone) {
2602
+        $result = DB::table('customer_service_after_sale_order')->where(function($query) use ($order_id, $name, $phone, $service_type) {
2601 2603
             if($order_id) $query->where('order_id',$order_id);
2602 2604
             if($name) $query->where('receiverName','like','%'.$name.'%');
2603 2605
             if($phone) $query->where('receiverMobile','like','%'.$phone.'%');
2606
+            if($service_type != 0) $query->where('service_type', $service_type);
2604 2607
         })->orderBy('id','desc')->offset($offset)->limit($pageSize)->get();
2605 2608
         $result = json_decode(json_encode($result),true);
2606 2609
 
@@ -2640,6 +2643,7 @@ class OrderController extends Controller
2640 2643
             'order_id'          => $order_id,
2641 2644
             'receiverName'      => $name,
2642 2645
             'receiverMobile'    => $phone,
2646
+            'service_type'      => $service_type,
2643 2647
         ]);
2644 2648
     }
2645 2649
 

+ 12 - 2
resources/views/order/customerServiceAfterSaleList.blade.php

@@ -17,6 +17,12 @@
17 17
                 <input id="receiverName" type="text"  class="input-text" style="width:6%;text-align:center" name="receiverName" value="{{$receiverName?$receiverName:''}}">
18 18
                 <input class="input-text" style="width:5%;text-align:center" type="text" value="手机号"/>
19 19
                 <input id="receiverMobile" type="text"  class="input-text" style="width:6%;text-align:center" name="receiverMobile" value="{{$receiverMobile?$receiverMobile:''}}">
20
+                <input type="text" style="width:5%;text-align:center" type="text" value="订单类型"/>
21
+                <select name="" id="service_type">
22
+                    <option value="0">请选择</option>
23
+                    <option value="1" @if($service_type == 1) selected @endif>退补</option>
24
+                    <option value="2" @if($service_type == 2) selected @endif>售后</option>
25
+                </select>
20 26
                 <div style="float:right">
21 27
                     <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
22 28
                 </div>
@@ -36,6 +42,7 @@
36 42
                     <th width="4%">发货时间</th>
37 43
                     <th width="4%">付款金额</th>
38 44
                     <th width="4%">付款方式</th>
45
+                    <th width="4%">订单类型</th>
39 46
                     <th width="5%">下单时间</th>
40 47
                     <th width="5%">操作</th>
41 48
                 </tr>
@@ -52,6 +59,7 @@
52 59
                             <td>{{$a['send_time']}}</td>
53 60
                             <td>{{$a['receivedAmount']}}</td>
54 61
                             <td>{{$a['payment_type']}}</td>
62
+                            <td>@if($a['service_type'] == 1) 退补 @elseif($a['service_type'] == 2) 售后 @endif</td>
55 63
                             <td>{{$a['createTime']}}</td>
56 64
                             <td>
57 65
                                 <a style="text-decoration:none" onClick='order_edit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>
@@ -184,7 +192,8 @@
184 192
             var receiverMobile = $('#receiverMobile').val();
185 193
             var order_id = $('#order_id').val();
186 194
             var page = '{{$page}}';
187
-            location.href = 'index?page='+page+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&order_id='+order_id;
195
+            var service_type = $('#service_type').val();
196
+            location.href = 'index?page='+page+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&order_id='+order_id+'&service_type='+service_type;
188 197
         }
189 198
 
190 199
         /*分页*/
@@ -196,7 +205,8 @@
196 205
                 var receiverName = $('#receiverName').val();
197 206
                 var receiverMobile = $('#receiverMobile').val();
198 207
                 var order_id = $('#order_id').val();
199
-                location.href = 'index?page='+num+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&order_id='+order_id;
208
+                var service_type = $('#service_type').val();
209
+                location.href = 'index?page='+num+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&order_id='+order_id+'&service_type='+service_type;
200 210
             }
201 211
         })
202 212