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/database/migrations/2024_03_11_141704_create_response_works_table.php b/database/migrations/2024_03_11_141704_create_response_works_table.php new file mode 100644 index 0000000..813fb8d --- /dev/null +++ b/database/migrations/2024_03_11_141704_create_response_works_table.php @@ -0,0 +1,34 @@ +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 @@ Подробнее