diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index 597aa50..b596e65 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -72,6 +72,8 @@ class MainController extends Controller }*/ $Data = DB::table('job_titles')-> selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> + where('categories.is_remove', '=', '0')-> + where('job_titles.is_remove', '=', '0')-> leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> join('categories', 'categories.id', '=', 'job_titles.position_id')-> groupBy('job_titles.id')->orderByDesc('job_titles.position_id')-> @@ -81,8 +83,7 @@ class MainController extends Controller $name_cat = ''; foreach ($Data as $it) { $it_arr = (array)$it; - if ($name_cat != $it_arr['catname']) - $name_cat = $it_arr['catname']; + if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname']; $Main_Job[$name_cat][] = $it_arr; } @@ -191,7 +192,9 @@ class MainController extends Controller */ $Data = DB::table('job_titles')-> - selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat'); + selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> + where('categories.is_remove', '=', '0')-> + where('job_titles.is_remove', '=', '0'); if (($request->has('job')) && ($request->get('job') > 0)) { $Data = $Data->where('job_title_id', $request->get('job')); }