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)