From 2702c67a9c390920f7039b5185b1d7acb10bd294 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: Sat, 27 Apr 2024 21:03:23 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/EmployerController.php | 7 ++- app/Http/Controllers/MainController.php | 16 ++--- app/Http/Controllers/WorkerController.php | 3 +- resources/views/employers/add_vacancy.blade.php | 64 ++++++++++++-------- .../views/employers/ajax/list_vacancy.blade.php | 4 +- resources/views/employers/cabinet45.blade.php | 10 +++ resources/views/employers/edit_vacancy.blade.php | 11 +++- resources/views/employers/list_answer.blade.php | 4 ++ resources/views/employers/list_vacancy.blade.php | 4 +- resources/views/index.blade.php | 15 +++++ resources/views/modals/send_worker_new.blade.php | 14 ++--- 11 files changed, 105 insertions(+), 47 deletions(-) diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 9bb19a4..1e0f159 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -165,7 +165,10 @@ class EmployerController extends Controller if (Auth()->user()->is_public) { $categories = Category::query()->active()->get(); - $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->where('is_bd', '=', '0')->get(); + $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> + where('is_remove', '=', '0')-> + where('is_bd', '=', '0')-> + get(); $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> WhereHas('users', @@ -316,7 +319,7 @@ class EmployerController extends Controller if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); } - $answer = $answer->with('response')->get(); + $answer = $answer->with('response')->OrderByDESC('id')->get(); return view('employers.list_answer', compact('answer', 'user_id', 'employer')); } diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index ffa0ec5..f425b87 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -39,8 +39,9 @@ class MainController extends Controller ->GroupBy('categories.id') ->get(); - $Position = Category::query()->where('is_remove', '=', '0')->get(); - $job_titles = Job_title::query()->where('is_remove', '=', 0)->get(); + //$Position = Category::query()->where('is_remove', '=', '0')->get(); + $Job_title = Job_title::query()->where('is_remove', '=', '0')-> + where('is_bd', '=', '0')->orderBy('name')->get(); /*$BigFlot = Array(); foreach ($Position as $position) { @@ -78,7 +79,7 @@ class MainController extends Controller where('job_titles.is_bd', '=' , '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')-> + groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> orderByDesc('job_titles.sort')->get()->toArray(); $Main_Job = array(); @@ -91,7 +92,7 @@ class MainController extends Controller $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); - return view('index', compact('news', 'job_titles', 'categories', 'employers', 'vacancy', 'Main_Job')); + return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job')); } public function search_vacancies(Request $request) { @@ -147,7 +148,8 @@ class MainController extends Controller public function vacancies(Request $request) { //должности - $Job_title = Job_title::query()->where('is_remove', '=', '0')->orderBy('name')->get(); + $Job_title = Job_title::query()->where('is_remove', '=', '0')-> + where('is_bd', '=', '0')->orderBy('name')->get(); $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') @@ -201,7 +203,7 @@ class MainController extends Controller } $Data = $Data->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')-> + groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> orderByDesc('job_titles.sort')->get()->toArray(); $Main_Job = array(); @@ -261,7 +263,7 @@ class MainController extends Controller } } - $Job_title = Job_title::query()->OrderBy('name')->get(); + $Job_title = Job_title::query()->where('is_bd', '=', '0')->OrderBy('name')->get(); $Query_count = $Query->count(); diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index d5f3c29..f581982 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -244,7 +244,7 @@ class WorkerController extends Controller $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> where('is_bd', '=' , '1')-> - OrderBy('name')->get(); + OrderByDesc('sort')->OrderBy('name')->get(); $Infoblocks = infobloks::query()->OrderBy('name')->get(); $stat = Static_worker::query()->where('year_month', '=', $get_date) @@ -878,6 +878,7 @@ class WorkerController extends Controller $message->to_user_id = $params['send_to_user_id']; $message->title = $params['send_title']; $message->text = $params['send_text']; + $message->ad_employer_id = $params['send_vacancy']; if ($request->has('send_file')) { $message->file = $request->file('send_file')->store("worker/$id", 'public'); } diff --git a/resources/views/employers/add_vacancy.blade.php b/resources/views/employers/add_vacancy.blade.php index 8f88ab8..1b868ee 100644 --- a/resources/views/employers/add_vacancy.blade.php +++ b/resources/views/employers/add_vacancy.blade.php @@ -75,6 +75,32 @@ +
+ +
+
+ +
+
+
+