sunhao 5 years ago
parent
commit
1b687376a1

+ 12 - 1
app/Http/Controllers/Admin/OrderController.php

@@ -218,6 +218,16 @@ class OrderController extends Controller
218 218
         })->where('is_del',0)->where('warehouse', $warehouse)->where('status', '>', 1)->where('delivery_date', '<=', $today_date)->orderBy('verify_time', 'asc')->offset($offset)->limit($pageSize)->get();
219 219
 
220 220
         $result = json_decode(json_encode($result),true);
221
+
222
+        $yestoday = date('Y-m-d', strtotime('-1 day'));
223
+        //获取超时未发订单
224
+        $order_overtime = Order::where('is_del',0)->where('warehouse', $warehouse)->where('status', '>', 1)->where('delivery_date', '<', $yestoday)->where('createTime', '>=', $_start)->where('logistics_id', '=', '')->lists('id');
225
+       
226
+        $overtime = [];
227
+        if(!empty($order_overtime)){
228
+            $overtime['list'] = json_decode(json_encode($order_overtime), true);
229
+            $overtime['count'] = count($order_overtime);           
230
+        }
221 231
                 
222 232
         $adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
223 233
         $adminList = json_decode(json_encode($adminList), true);
@@ -234,7 +244,8 @@ class OrderController extends Controller
234 244
             'receiverMobile'       =>$receiverMobile,
235 245
             'id'       =>$id,
236 246
             'today'    =>$today_date,
237
-            'yestoday'    => date('Y-m-d', strtotime('-1 day')),
247
+            'yestoday'    => $yestoday,
248
+            'overtime'    => $overtime,
238 249
             ]);
239 250
     }
240 251
 

+ 2 - 2
resources/views/order/warehouselist.blade.php

@@ -60,14 +60,14 @@
60 60
                 <tbody>
61 61
                 @if($result)
62 62
                     @foreach($result as $a)
63
-                        <tr class="text-c" style=" text-align:center; ">                           
63
+                        <tr class="text-c" style=" text-align:center; @if($a['delivery_date'] < $yestoday && !$a['logistics_id']) background-color: #FF0000; @elseif($a['delivery_date'] < $today && !$a['logistics_id']) background-color: #f37b1d; @endif">                           
64 64
                             <td>{{$a['id']}}</td>                            
65 65
                             <td>{{$a['customerName']}}</td>                            
66 66
                             <td>{{$a['receiverName']}}</td>                            
67 67
                             <td>{{$a['receiverMobile']}}</td>                            
68 68
                             <td>{{$a['receiverState']}}{{$a['receiverCity']}}{{$a['receiverDistrict']}}{{$a['receiverStreet']}}{{$a['receiverAddress']}}</td>                            
69 69
                             <td>{{$a['goods_note']}}</td>                            
70
-                            <td style="@if($a['delivery_date'] < $yestoday && !$a['logistics_id']) background-color: #FF0000; @elseif($a['delivery_date'] < $today && !$a['logistics_id']) background-color: #f37b1d; @endif">{{$a['delivery_date']}}</td>                            
70
+                            <td style="">{{$a['delivery_date']}}</td>                            
71 71
                             <td>{{$a['verify_time']}}</td>                            
72 72
                             <td class ="change_logistics_id"> 
73 73
                                 <p id="logi_1{{$a['id']}}">{{$a['logistics_id']}}</p>