diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index d86356c..ddbeaca 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -163,9 +163,9 @@ class EmployerController extends Controller $id = Auth()->user()->id; $categories = Category::query()->active()->get(); - $Positions = Category::query()->active()->get(); - if ($Positions->count()) { - $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', $Positions[0]->id)->get(); + + if ($categories->count()) { + $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', $categories[0]->id)->get(); } else { $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', 0)->get(); } @@ -174,8 +174,7 @@ class EmployerController extends Controller WhereHas('users', function (Builder $query) use ($id) {$query->Where('id', $id); })->get(); - - return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); + return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories')); } // Сохранение вакансии diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index ce89503..e90e4c4 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -79,6 +79,7 @@ class MainController extends Controller groupBy('job_titles.id')->orderByDesc('job_titles.position_id')-> orderByDesc('job_titles.sort')->get()->toArray(); + $Main_Job = array(); $name_cat = ''; foreach ($Data as $it) { diff --git a/resources/views/employers/add_vacancy.blade.php b/resources/views/employers/add_vacancy.blade.php index 5507868..a75d9ef 100644 --- a/resources/views/employers/add_vacancy.blade.php +++ b/resources/views/employers/add_vacancy.blade.php @@ -128,13 +128,11 @@