diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index 6817021..ecbde34 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -58,16 +58,11 @@ class MainController extends Controller //категории и вакансии if (($request->has('job')) && ($request->get('job') > 0)) { - $categories = $categories->Where('job_title_id', '=', $request->get('job')) - ->OrderByDesc('created_at') - ->GroupBy('categories.id') - ->get(); - } else { - $categories = $categories->OrderByDesc('created_at') - ->GroupBy('categories.id') - ->get(); + $categories = $categories->Where('job_title_id', '=', $request->get('job')); } + $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); + if ($request->ajax()) { return view('ajax.vacancies', compact('categories')); } else { diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index 23da521..129c0ed 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -14,6 +14,7 @@ use App\Models\Job_title; use App\Models\Message; use App\Models\place_works; use App\Models\reclame; +use App\Models\ResponseWork; use App\Models\sertification; use App\Models\Static_worker; use App\Models\User; @@ -379,6 +380,31 @@ class WorkerController extends Controller } } + + // Звездная оценка и ответ + public function stars_answer(Request $request) { + $params = $request->all(); + $rules = [ + 'message' => ['required', 'string', 'max:255'], + ]; + + $messages = [ + 'required' => 'Укажите обязательное поле', + 'min' => [ + 'string' => 'Поле «:attribute» должно быть не меньше :min символов', + 'integer' => 'Поле «:attribute» должно быть :min или больше', + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' + ], + 'max' => [ + 'string' => 'Поле «:attribute» должно быть не больше :max символов', + 'integer' => 'Поле «:attribute» должно быть :max или меньше', + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' + ] + ]; + $response_worker = ResponseWork::create($params); + return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); + } + // Создание пользователя protected function create(array $data) { @@ -447,7 +473,7 @@ class WorkerController extends Controller } - //Переписка пись-пись-пись + //Переписка public function dialog(User_Model $user1, User_Model $user2) { if (isset($user2->id)) { $companion = User_Model::query()->with('workers')-> @@ -597,5 +623,6 @@ class WorkerController extends Controller $ad_responce = ad_response::create($data); return redirect()->route('worker.messages', ['type_message' => 'output']); } + } diff --git a/app/Models/ResponseWork.php b/app/Models/ResponseWork.php new file mode 100644 index 0000000..1671a83 --- /dev/null +++ b/app/Models/ResponseWork.php @@ -0,0 +1,17 @@ +id(); + $table->bigInteger('worker_id')->nullable(false); + $table->integer('stars')->nullable(true); + $table->string('message', 255)->default('Без комментариев'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('response_works'); + } +}; diff --git a/resources/views/ajax/list_vacancies.blade.php b/resources/views/ajax/list_vacancies.blade.php index d8162b4..6cbb7ce 100644 --- a/resources/views/ajax/list_vacancies.blade.php +++ b/resources/views/ajax/list_vacancies.blade.php @@ -63,7 +63,7 @@ Подробнее
-
{{ $Q->created_at }}
+
{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}
@@ -74,7 +74,6 @@ -
@@ -101,7 +100,7 @@
{{ $Q_item->title }}
- + {{ $Q_item->title }} {!! $Q_item->text !!} Читать далее diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.php new file mode 100644 index 0000000..aa70d9e --- /dev/null +++ b/resources/views/errors/404.blade.php @@ -0,0 +1,19 @@ +@extends('layout.frontend', ['title' => 'Судоходные компании РекаМоре']) + +@section('scripts') + +@endsection + +@section('content') +
+
+
+
404
+
Упс! Страница не найдена
+
Такой страницы не существует. Воспользуйтесь меню или перейдите на главную.
+ Перейти на главную +
+
+
+@endsection + diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 2c02550..1dcb409 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -178,7 +178,7 @@
- + {{ $new->title }} {{ mb_strimwidth($new->text, 0, 100) }} Читать далее diff --git a/resources/views/info_company_new.blade.php b/resources/views/info_company_new.blade.php index 6fdbe00..3b66557 100644 --- a/resources/views/info_company_new.blade.php +++ b/resources/views/info_company_new.blade.php @@ -241,7 +241,7 @@ class="button button_light main__employer-page-two-item-button">Подробнее-->
-
{{ $job->updated_at }}
+
{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}
- - - - - - - diff --git a/resources/views/list_vacancies.blade.php b/resources/views/list_vacancies.blade.php index 29b3ec1..b8ca4ec 100644 --- a/resources/views/list_vacancies.blade.php +++ b/resources/views/list_vacancies.blade.php @@ -225,7 +225,7 @@ Подробнее
-
{{ $Q->created_at }}
+
{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}
@endforeach -
- {{ $Query->appends($_GET)->links('paginate') }} @else
diff --git a/resources/views/paginate.blade.php b/resources/views/paginate.blade.php index f10ebbd..ed46ef9 100644 --- a/resources/views/paginate.blade.php +++ b/resources/views/paginate.blade.php @@ -1,7 +1,11 @@ @if ($paginator->hasPages()) @endif diff --git a/resources/views/vacance-item.blade.php b/resources/views/vacance-item.blade.php index 61b377e..a371138 100644 --- a/resources/views/vacance-item.blade.php +++ b/resources/views/vacance-item.blade.php @@ -109,7 +109,7 @@
-
{{ $Q->created_at }}
+
{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}
+
diff --git a/routes/web.php b/routes/web.php index 9ead850..1107b5b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -442,6 +442,8 @@ Route::get('register_employer', [EmployerController::class, 'register_employer'] //восстановление пароля Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); +// Звезда сообщения +Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); // Борьба Route::get('clear_cookie', function() {