From 2726f0123ad3a4a074966124e5bd103664535791 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, 7 May 2024 22:27:57 +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=D0=B1=D0=B0=D0=B3=D0=B0=D0=BC=20=D0=B4=D0=BE=2035=20=D0=BF=D1?= =?UTF-8?q?=83=D0=BD=D0=BA=D1=82=D0=B0=20(=D0=BD=D0=B5=20=D0=B2=D0=BA=D0=BB=D1?= =?UTF-8?q?=8E=D1=87=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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/js/favorite-worker.blade.php | 1 + resources/views/layout/frontend.blade.php | 5 +++++ resources/views/worker.blade.php | 6 ++++-- resources/views/workers/docs.blade.php | 10 +++++----- resources/views/workers/prev_company_form.blade.php | 4 ++-- 9 files changed, 37 insertions(+), 17 deletions(-) diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index f581982..4398472 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)