From bf37e1f276bd843d2c6db19c9977f1640677e40a Mon Sep 17 00:00:00 2001 From: "HESU\\HESU" <1696136552@qq.com> Date: Tue, 10 Jun 2025 17:19:58 +0800 Subject: [PATCH] 1 --- app/controller/LocationController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {