From 4c2bb426124ae9b5314def5ccf22fa525952c0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Tue, 16 Apr 2024 19:49:28 +0700 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B0=D1?= =?UTF-8?q?=8F=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BE=D1=87=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D0=BA=D0=B0=D1=82=D0=B5=D0=B3=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D1=8F=D0=BC=20=D1=81=D0=BF=D0=B5=D1=86=D0=B8=D0=B0=D0=BB=D1=8C=D0?= =?UTF-8?q?=BD=D0=BE=D1=81=D1=82=D1=8F=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/MainController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index 4905419..f60a949 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; } @@ -190,7 +191,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')); } -- 1.7.10.4