From b947a4cd59a0e4d92fb7fdc34f0095aaea9437bc 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 17:40:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=20=D1=81=D1=83?= =?UTF-8?q?=D0=B1=D0=B1=D0=BE=D1=82=D0=B0=202?= 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 7d1aa4b..7fb1a3b 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', @@ -317,7 +320,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 a5dfb3f..2f5e2e1 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') @@ -202,7 +204,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(); @@ -262,7 +264,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 9edb28f..c62ca91 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) @@ -879,6 +879,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 @@ +
+ +
+
+ +
+
+
+