From 7c475b9ed29c39e96fc1455b94fad178eab72eaa Mon Sep 17 00:00:00 2001 From: Sergey Panarin Date: Tue, 13 Aug 2024 10:04:25 +0200 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/MainController.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index 401d272..e600958 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -188,14 +188,16 @@ class MainController extends Controller else $job_search = $request->get('job'); - $Query = Ad_employer::with('jobs')-> - with('cat')-> - with('employer')-> - whereHas('jobs_code', function ($query) use ($job_search) { - if (!empty($job_search)) { - $query->where('job_title_id', $job_search); - } - })->select('ad_employers.*'); + $Query = Ad_employer::with('jobs') + ->with('cat') + ->with('employer') + ->where('is_remove', 0) + ->whereHas('jobs_code', function ($query) use ($job_search) { + if (!empty($job_search)) { + $query->where('job_title_id', $job_search); + } + }) + ->select('ad_employers.*'); if (isset($categories->id) && ($categories->id > 0)) { $Query = $Query->where('category_id', '=', $categories->id); -- 1.7.10.4