From a6f8bc8dbc03152f076438f8c11fd011db152633 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Sat, 9 Aug 2025 11:01:49 +0800 Subject: [PATCH] update --- app/Http/Controllers/Mobile/SupplyDemandController.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Mobile/SupplyDemandController.php b/app/Http/Controllers/Mobile/SupplyDemandController.php index 57f00e5..6d15121 100755 --- a/app/Http/Controllers/Mobile/SupplyDemandController.php +++ b/app/Http/Controllers/Mobile/SupplyDemandController.php @@ -48,17 +48,16 @@ class SupplyDemandController extends CommonController public function index() { $all = request()->all(); + $status = request('status', 1); $supplyDemands = SupplyDemand::with([ 'user' => function ($query) { $query->select('id', 'nickname', 'name', 'headimgurl', 'username'); } - ])->where(function ($query) use ($all) { + ])->where(function ($query) use ($all, $status) { + $query->where('status', $status); if (isset($all['type'])) { $query->where('type', $all['type']); } - if (isset($all['status'])) { - $query->where('status', $all['status']); - } if (isset($all['keyword'])) { $query->where('content', 'like', '%' . $all['keyword'] . '%'); }