diff --git a/app/controller/LocationController.php b/app/controller/LocationController.php index 86d03a0..d2dce64 100644 --- a/app/controller/LocationController.php +++ b/app/controller/LocationController.php @@ -15,7 +15,9 @@ class LocationController public function index(Request $request) { $locations = Location::with('vehicles') - ->with('fboVehicles') + ->with(['fboVehicles' => function($query) { + $query->where([['status','!=', 4]]); // 对关联表 posts 加条件 + }]) ->whereIn('type',['port','warehouse']) ->get() ->map(function ($location) {