Blame view
app/Http/Controllers/Ad_jobsController.php
4.44 KB
d7c3522a7 Коммит изменение ... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
<?php namespace App\Http\Controllers; use App\Classes\RusDate; use App\Classes\Tools; use App\Http\Requests\FlotRequest; use App\Http\Requests\MessagesRequiest; use App\Http\Requests\VacancyRequestEdit; use App\Http\Requests\VacansiaRequiest; use App\Mail\MailSotrudnichestvo; use App\Mail\SendAllMessages; use App\Models\Ad_employer; use App\Models\Ad_jobs; use App\Models\ad_response; use App\Models\Category; use App\Models\Education; use App\Models\Employer; use App\Models\employers_main; use App\Models\Flot; use App\Models\Job_title; use App\Models\Like_vacancy; use App\Models\Like_worker; use App\Models\Message; use App\Models\Positions; use App\Models\Worker; use Carbon\Carbon; use Illuminate\Auth\Events\Registered; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Auth\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Storage; use App\Models\User as User_Model; use Illuminate\Support\Facades\Validator; class Ad_jobsController extends Controller { public function add_job_in_vac(Request $request, Ad_employer $ad_employer) { $id = Auth()->user()->id; |
2c676e6ce Обновление 6 |
45 |
$Positions = Category::query()->active()->get(); |
f364ad5b7 Коммит по вакансиям |
46 47 48 49 50 51 |
/*if ($Positions->count()) { $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> where('is_remove', '=', '0')-> where('is_bd', '=', '0')-> where('position_id', $Positions[0]->id)-> get(); |
d7c3522a7 Коммит изменение ... |
52 |
} else { |
f364ad5b7 Коммит по вакансиям |
53 54 55 56 57 |
$jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> where('is_remove', '=', '0')-> where('is_bd', '=', '0')-> where('position_id', 0)-> get(); |
d7c3522a7 Коммит изменение ... |
58 |
} |
f364ad5b7 Коммит по вакансиям |
59 60 61 62 63 |
*/ $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> where('is_remove', '=', '0')-> where('is_bd', '=', '0')-> get(); |
d7c3522a7 Коммит изменение ... |
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
$categories = Category::query()->get(); $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> where('user_id', $id)->first(); return view('employers.add_ad_jobs', compact('ad_employer', 'Positions', 'categories', 'jobs', 'Employer')); } public function add_job_in_vac_save(Request $request) { $params = $request->all(); Ad_jobs::create($params); return redirect()->route('employer.vacancy_list'); } |
8f150320c Работа рефакторинг |
79 |
public function edit_job_in_vac(Ad_jobs $ad_job, Ad_employer $ad_employer, Request $request) { |
d7c3522a7 Коммит изменение ... |
80 |
$id = Auth()->user()->id; |
8f150320c Работа рефакторинг |
81 82 83 84 |
if ($request->has('job_title_id')) $job_title_id= $request->get('job_title_id'); else $job_title_id = ''; |
d7c3522a7 Коммит изменение ... |
85 |
|
2c676e6ce Обновление 6 |
86 |
$Positions = Category::query()->active()->get(); |
f364ad5b7 Коммит по вакансиям |
87 88 89 90 91 92 |
/*if ($Positions->count()) { $jobs123 = Job_title::query()-> orderByDesc('sort')->OrderBy('name')-> where('is_remove', '=', '0')-> where('is_bd', '=', '0')-> where('position_id', $ad_job->job_title->position_id )->get(); |
d7c3522a7 Коммит изменение ... |
93 |
} else { |
f364ad5b7 Коммит по вакансиям |
94 95 96 97 98 99 100 101 102 103 104 105 |
$jobs123 = Job_title::query()-> orderByDesc('sort')->OrderBy('name')-> where('is_remove', '=', '0')-> where('is_bd', '=', '0')-> where('position_id', 0)->get(); }*/ $jobs123 = Job_title::query()-> orderByDesc('sort')->OrderBy('name')-> where('is_remove', '=', '0')-> where('is_bd', '=', '0')-> get(); |
8f150320c Работа рефакторинг |
106 |
|
d7c3522a7 Коммит изменение ... |
107 108 |
$Employer = Employer::query()->with('users')->with('ads')->with('flots')-> where('user_id', $id)->first(); |
d7c3522a7 Коммит изменение ... |
109 |
return view('employers.edit_ad_jobs', compact('ad_job', |
8f150320c Работа рефакторинг |
110 111 |
'Positions', 'Employer','jobs123', 'ad_employer', 'job_title_id')); |
d7c3522a7 Коммит изменение ... |
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
} public function edit_job_in_vac_save(Request $request, Ad_jobs $ad_job) { $params = $request->all(); $ad_job->update($params); return redirect()->route('employer.vacancy_list'); } public function delete_job_in_vac(Ad_jobs $ad_job) { $ad_job->delete(); return redirect()->route('employer.vacancy_list'); } } |