Browse Source

只能看到自己团队未发货订单

sunhao 5 years ago
parent
commit
e02052c5b1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/Http/Controllers/Admin/OrderController.php

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

@@ -175,7 +175,9 @@ class OrderController extends Controller
175 175
 
176 176
         $yestoday = date('Y-m-d', strtotime('-1 day'));
177 177
         //获取超时未发订单
178
-        $order_overtime = Order::where('is_del',0)->whereIn('status', [2,3])->where('delivery_date', '<', $yestoday)->where('createTime', '>=', '2019-09-18')->where('logistics_id', '=', '')->lists('id');
178
+        $order_overtime = Order::where('is_del',0)->whereIn('status', [2,3])->where('delivery_date', '<', $yestoday)->where('createTime', '>=', '2019-09-18')->where('logistics_id', '=', '')->where(function($query) use($team_id, $self_role){
179
+            if($self_role == '管理员') $query->where('team_id', $team_id);
180
+        })->lists('id');
179 181
        
180 182
         $overtime = [];
181 183
         if(!empty($order_overtime)){