diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 9bb19a4..1e0f159 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -165,7 +165,10 @@ class EmployerController extends Controller if (Auth()->user()->is_public) { $categories = Category::query()->active()->get(); - $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->where('is_bd', '=', '0')->get(); + $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> + where('is_remove', '=', '0')-> + where('is_bd', '=', '0')-> + get(); $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> WhereHas('users', @@ -316,7 +319,7 @@ class EmployerController extends Controller if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); } - $answer = $answer->with('response')->get(); + $answer = $answer->with('response')->OrderByDESC('id')->get(); return view('employers.list_answer', compact('answer', 'user_id', 'employer')); } diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index ffa0ec5..f425b87 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -39,8 +39,9 @@ class MainController extends Controller ->GroupBy('categories.id') ->get(); - $Position = Category::query()->where('is_remove', '=', '0')->get(); - $job_titles = Job_title::query()->where('is_remove', '=', 0)->get(); + //$Position = Category::query()->where('is_remove', '=', '0')->get(); + $Job_title = Job_title::query()->where('is_remove', '=', '0')-> + where('is_bd', '=', '0')->orderBy('name')->get(); /*$BigFlot = Array(); foreach ($Position as $position) { @@ -78,7 +79,7 @@ class MainController extends Controller where('job_titles.is_bd', '=' , '0')-> leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> join('categories', 'categories.id', '=', 'job_titles.position_id')-> - groupBy('job_titles.id')->orderByDesc('job_titles.position_id')-> + groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> orderByDesc('job_titles.sort')->get()->toArray(); $Main_Job = array(); @@ -91,7 +92,7 @@ class MainController extends Controller $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); - return view('index', compact('news', 'job_titles', 'categories', 'employers', 'vacancy', 'Main_Job')); + return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job')); } public function search_vacancies(Request $request) { @@ -147,7 +148,8 @@ class MainController extends Controller public function vacancies(Request $request) { //должности - $Job_title = Job_title::query()->where('is_remove', '=', '0')->orderBy('name')->get(); + $Job_title = Job_title::query()->where('is_remove', '=', '0')-> + where('is_bd', '=', '0')->orderBy('name')->get(); $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') @@ -201,7 +203,7 @@ class MainController extends Controller } $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> join('categories', 'categories.id', '=', 'job_titles.position_id')-> - groupBy('job_titles.id')->orderByDesc('job_titles.position_id')-> + groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> orderByDesc('job_titles.sort')->get()->toArray(); $Main_Job = array(); @@ -261,7 +263,7 @@ class MainController extends Controller } } - $Job_title = Job_title::query()->OrderBy('name')->get(); + $Job_title = Job_title::query()->where('is_bd', '=', '0')->OrderBy('name')->get(); $Query_count = $Query->count(); diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index d5f3c29..f581982 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -244,7 +244,7 @@ class WorkerController extends Controller $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> where('is_bd', '=' , '1')-> - OrderBy('name')->get(); + OrderByDesc('sort')->OrderBy('name')->get(); $Infoblocks = infobloks::query()->OrderBy('name')->get(); $stat = Static_worker::query()->where('year_month', '=', $get_date) @@ -878,6 +878,7 @@ class WorkerController extends Controller $message->to_user_id = $params['send_to_user_id']; $message->title = $params['send_title']; $message->text = $params['send_text']; + $message->ad_employer_id = $params['send_vacancy']; if ($request->has('send_file')) { $message->file = $request->file('send_file')->store("worker/$id", 'public'); } diff --git a/resources/views/employers/add_vacancy.blade.php b/resources/views/employers/add_vacancy.blade.php index 8f88ab8..1b868ee 100644 --- a/resources/views/employers/add_vacancy.blade.php +++ b/resources/views/employers/add_vacancy.blade.php @@ -75,6 +75,32 @@ +
+ +
+
+ +
+
+
+