Зарплата:{{ $item->min_salary }} - {{ $item->max_salary }}р + {{ $item->sytki }} суточные.
-Контракт: {{ $item->period }} мес.
-diff --git a/app/Http/Controllers/Admin/InfoBloksController.php b/app/Http/Controllers/Admin/InfoBloksController.php index 93e5c8e..e90363f 100644 --- a/app/Http/Controllers/Admin/InfoBloksController.php +++ b/app/Http/Controllers/Admin/InfoBloksController.php @@ -15,7 +15,9 @@ class InfoBloksController extends Controller */ public function index() { - $infobloks = infobloks::query()->active()->orderByDesc('sort')->orderBy('name')->paginate(15); + $infobloks = infobloks::query()-> + //active()-> + orderByDesc('sort')->orderBy('name')->paginate(15); return view('admin.infobloks.index', compact('infobloks')); } @@ -84,7 +86,7 @@ class InfoBloksController extends Controller */ public function destroy(infobloks $infoblok) { - $infoblok->update(['is_remove' => 1]); + $infoblok->delete(); // update(['is_remove' => 1]); return redirect()->route('admin.infobloks.index'); } } diff --git a/app/Http/Controllers/Admin/UsersController.php b/app/Http/Controllers/Admin/UsersController.php index db24174..394d6d5 100644 --- a/app/Http/Controllers/Admin/UsersController.php +++ b/app/Http/Controllers/Admin/UsersController.php @@ -45,6 +45,12 @@ class UsersController extends Controller } } + public function user_delete(User $user) { + $id = $user->delete(); + + return redirect()->route('admin.users')->with('Пользователь был удален из системы'); + } + public function index_bd(Request $request) { $title = 'Админка - Пользователи базы данных'; diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index ad4da01..7867b80 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Models\Ad_employer; use App\Models\Employer; use Illuminate\Http\Request; @@ -52,6 +53,10 @@ class CompanyController extends Controller $title = $company[0]->name_company; - return view('info_company_new', compact('company', 'user_id', 'title')); + $ads = Ad_employer::query()->with('jobs')->with('jobs_code')-> + OrderByDesc('id')-> + where('employer_id', '=', $company[0]->id)->paginate(2); + + return view('info_company_new', compact('company', 'user_id', 'title', 'ads')); } } diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 42eecd3..55e8bd3 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -164,18 +164,15 @@ class EmployerController extends Controller if (Auth()->user()->is_public) { $categories = Category::query()->active()->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', function (Builder $query) use ($id) { $query->Where('id', $id); })->get(); - return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); } else { return redirect()->route('employer.cabinet_vacancie_danger'); @@ -249,18 +246,19 @@ class EmployerController extends Controller public function vacancy_edit(Ad_employer $ad_employer) { $id = Auth()->user()->id; $Positions = Category::query()->where('is_remove', '=', '0')->get(); - $jobs = Job_title::query()->OrderBy('name')-> - where('is_remove', 0)->where('is_bd', '=' , '0')->get(); - - $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> - where('user_id', $id)->first(); + $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')->where('user_id', $id)->first(); return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); } // Сохранение-редактирование записи public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { $params = $request->all(); + $params_job["job_title_id"] = $params['job_title_id']; //$jobs['flot'] = $params['flot']; //$jobs['job_title_id'] = $params['job_title_id']; @@ -268,6 +266,7 @@ class EmployerController extends Controller //unset($params['job_title_id']); $ad_employer->update($params); + $ad_employer->jobs()->sync($request->get('job_title_id')); //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> // where('ad_employer_id', $ad_employer->id)->first(); diff --git a/resources/views/admin/users/index.blade.php b/resources/views/admin/users/index.blade.php index 1cd6621..dadc982 100644 --- a/resources/views/admin/users/index.blade.php +++ b/resources/views/admin/users/index.blade.php @@ -62,6 +62,7 @@
Зарплата:{{ $item->min_salary }} - {{ $item->max_salary }}р + {{ $item->sytki }} суточные.
-Контракт: {{ $item->period }} мес.
-