diff --git a/app/Http/Controllers/Admin/JobTitlesController.php b/app/Http/Controllers/Admin/JobTitlesController.php index 232875e..dbbfe0a 100644 --- a/app/Http/Controllers/Admin/JobTitlesController.php +++ b/app/Http/Controllers/Admin/JobTitlesController.php @@ -16,10 +16,19 @@ class JobTitlesController extends Controller * * @return \Illuminate\Http\Response */ - public function index() + public function index(Request $request) { - $Jobs = Job_title::query()->where('is_remove', '=', '0')-> - orderByDesc('sort')->orderBy('name')->paginate(15); + if ($request->has('sort')) { + $Jobs = Job_title::query()->where('is_remove', '=', '0'); + if ($request->get('sort') == 'up') + $Jobs = $Jobs->orderBy('sort')->orderBy('name')->paginate(15); + else + $Jobs = $Jobs->orderByDesc('sort')->orderBy('name')->paginate(15); + } else { + $Jobs = Job_title::query()->where('is_remove', '=', '0')-> + orderByDesc('sort')->orderBy('name')->paginate(15); + } + return view('admin.job_titles.index', compact('Jobs')); } diff --git a/app/Http/Controllers/Admin/MsgAnswersController.php b/app/Http/Controllers/Admin/MsgAnswersController.php index a1c4597..c4c6a37 100644 --- a/app/Http/Controllers/Admin/MsgAnswersController.php +++ b/app/Http/Controllers/Admin/MsgAnswersController.php @@ -107,7 +107,7 @@ class MsgAnswersController extends Controller $id_admin = Auth::user()->id; $users = User::query()->OrderBy('name')->where('is_bd', '=', '0')->get(); - $Msgs = Message::with('user_from')->with('user_to')->with('response') + $Msgs = Message::with('user_from')->with('user_to') //->with('response') ->where(function($query) use ($id_admin) { $query->where('user_id', '=', $id_admin) ->orWhere('to_user_id', '=', $id_admin); diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 90ad08b..9479f9a 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -226,10 +226,12 @@ class EmployerController extends Controller switch ($sort) { case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; + case 'nopublic': $vacancy_list = $vacancy_list->OrderBy('active_is')->orderBy('id'); break; + case 'public': $vacancy_list = $vacancy_list->OrderByDesc('active_is')->orderBy('id'); break; case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; - case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; - default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; + case 'default': $vacancy_list = $vacancy_list->orderbyDesc('updated_at')->orderBy('name'); break; + default: $vacancy_list = $vacancy_list->orderByDesc('id')->orderbyDesc('updated_at'); break; } } $vacancy_list = $vacancy_list->paginate(4); diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 2a5ae74..77e8f60 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -16,8 +16,9 @@ class PagesController extends Controller { public function pages(pages $pages) { $page = pages::query()->where('slug', $pages->slug)->first(); + $slug = $pages->slug; - return view('pages', compact('page')); + return view('pages', compact('page', 'slug')); } public function form_feedback(RequestSendAdmin $request){ diff --git a/resources/views/TITLE_TEXT.blade.php b/resources/views/TITLE_TEXT.blade.php new file mode 100644 index 0000000..83ecec1 --- /dev/null +++ b/resources/views/TITLE_TEXT.blade.php @@ -0,0 +1,18 @@ +
{!! $page->anons !!}
+ @if ($slug == 'Usloviya-razmescheniya') + + @endif