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);