From 4a6e91624fbd93276f2de6fe53c4568378de32be 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: Wed, 8 May 2024 15:41:28 +0300 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=D0=BA=D0=B0=D0=B1=D0=B8=D0=BD=D0=B5=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/MainController.php | 6 +++++- app/Http/Controllers/WorkerController.php | 9 ++++++--- app/Http/Requests/DocumentsRequest.php | 10 +++++++++- app/Http/Requests/PrevCompanyRequest.php | 6 +++--- resources/views/ajax/resume_1.blade.php | 3 ++- resources/views/employers/list_vacancy.blade.php | 7 +++++++ resources/views/js/favorite-worker.blade.php | 1 + resources/views/layout/frontend.blade.php | 5 +++++ resources/views/vacance-item.blade.php | 3 ++- resources/views/worker.blade.php | 6 ++++-- resources/views/workers/docs.blade.php | 10 +++++----- resources/views/workers/prev_company_form.blade.php | 4 ++-- 12 files changed, 51 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index 2f5e2e1..c53efc6 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -90,7 +90,11 @@ class MainController extends Controller $Main_Job[$name_cat][] = $it_arr; } - $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); + $employers = employers_main::query()->with('employer')-> + whereHas('employer', function ($query) { + $query->where('status_hidden', '=', '0'); + })-> + orderBy('id')->limit(8)->get(); $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job')); } diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index c62ca91..85bc62a 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -96,7 +96,10 @@ class WorkerController extends Controller }); } - $Job_title = Job_title::query()->get(); + $Job_title = Job_title::query()-> + where('is_remove', '=', '0')-> + where('is_bd', '=' , '1')-> + get(); if ($request->get('sort')) { $sort = $request->get('sort'); @@ -169,7 +172,7 @@ class WorkerController extends Controller $get_date = date('Y.m'); $c = Static_worker::query()->where('year_month', '=', $get_date) - ->where('user_id', '=', $worker->id) + ->where('user_id', '=', $worker->user_id) ->get(); if ($c->count() > 0) { @@ -181,7 +184,7 @@ class WorkerController extends Controller $crt->lookin = 1; $crt->year_month = $get_date; $crt->user_id = $worker->user_id; - $crt->save(); + $status = $crt->save(); } $stat = Static_worker::query()->where('year_month', '=', $get_date) ->where('user_id', '=', $worker->id) diff --git a/app/Http/Requests/DocumentsRequest.php b/app/Http/Requests/DocumentsRequest.php index a557d59..3cb70bc 100644 --- a/app/Http/Requests/DocumentsRequest.php +++ b/app/Http/Requests/DocumentsRequest.php @@ -27,12 +27,20 @@ class DocumentsRequest extends FormRequest 'job_title' => ['required', 'string', 'max:255'], 'teplohod' => ['required', 'string', 'max:255'], 'name_company' => ['required', 'string', 'max:255'], + 'GWT' => ['required', 'string', 'max:255'], + 'GRT' => ['required', 'string', 'max:255'], ]; } public function messages() { return [ - 'required' => 'Укажите обязательное поле «:attribute»', + 'job_title.required' => 'Укажите обязательное поле "Должность"', + 'teplohod.required' => 'Укажите обязательное поле "Название т/х"', + 'name_company.required' => 'Укажите обязательное поле "Название компании"', + 'GWT.required' => 'Укажите обязательное поле "Тип судна"', + 'GRT.required' => 'Укажите обязательное поле "Водоизмещение"', + + //'required' => 'Укажите обязательное поле «:attribute»', 'min' => [ 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 'integer' => 'Поле «:attribute» должно быть :min или больше', diff --git a/app/Http/Requests/PrevCompanyRequest.php b/app/Http/Requests/PrevCompanyRequest.php index a16ebcd..20580cb 100644 --- a/app/Http/Requests/PrevCompanyRequest.php +++ b/app/Http/Requests/PrevCompanyRequest.php @@ -27,13 +27,11 @@ class PrevCompanyRequest extends FormRequest 'name_company' => [ 'required', 'string', - 'min:3', 'max:255', ], 'direct' => [ 'required', 'string', - 'min:3', 'max:255' ], ]; @@ -41,7 +39,9 @@ class PrevCompanyRequest extends FormRequest public function messages() { return [ - 'required' => 'Поле :attribute обязательно для ввода', + //'required' => 'Поле :attribute обязательно для ввода', + 'name_company.required' => 'Укажите обязательное поле "Название компании"', + 'direct.required' => 'Укажите обязательное поле "ФИО сотрудника"', 'unique' => 'Поле :attribute должно быть уникальным', 'mimes' => 'Допускаются файлы только с расширением jpeg,jpg,png', 'numeric' => 'Поле :attribute должно быть числом', diff --git a/resources/views/ajax/resume_1.blade.php b/resources/views/ajax/resume_1.blade.php index 5cd9cb4..dc272de 100644 --- a/resources/views/ajax/resume_1.blade.php +++ b/resources/views/ajax/resume_1.blade.php @@ -1,4 +1,5 @@ - +@if ($resumes->count()) + @foreach ($resumes as $res)