Commit 3e8ab15f22514b4315d6aa693342b75fe2405821
1 parent
b8701187c1
Exists in
master
and in
1 other branch
Статусы должностей и разные видимости
Showing 6 changed files with 17 additions and 12 deletions Side-by-side Diff
app/Http/Controllers/EmployerController.php
... | ... | @@ -168,7 +168,7 @@ class EmployerController extends Controller |
168 | 168 | //} else { |
169 | 169 | // $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', 0)->get(); |
170 | 170 | //} |
171 | - $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->get(); | |
171 | + $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->where('is_bd', '=' , '0')->get(); | |
172 | 172 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
173 | 173 | WhereHas('users', |
174 | 174 | function (Builder $query) use ($id) {$query->Where('id', $id); |
... | ... | @@ -231,7 +231,8 @@ class EmployerController extends Controller |
231 | 231 | public function vacancy_edit(Ad_employer $ad_employer) { |
232 | 232 | $id = Auth()->user()->id; |
233 | 233 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); |
234 | - $jobs = Job_title::query()->OrderBy('name')->where('is_remove', 0)->get(); | |
234 | + $jobs = Job_title::query()->OrderBy('name')-> | |
235 | + where('is_remove', 0)->where('is_bd', '=' , '0')->get(); | |
235 | 236 | |
236 | 237 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
237 | 238 | where('user_id', $id)->first(); |
app/Http/Controllers/MainController.php
... | ... | @@ -41,6 +41,7 @@ class MainController extends Controller |
41 | 41 | |
42 | 42 | $Position = Category::query()->where('is_remove', '=', '0')->get(); |
43 | 43 | $job_titles = Job_title::query()->where('is_remove', '=', 0)->get(); |
44 | + | |
44 | 45 | /*$BigFlot = Array(); |
45 | 46 | foreach ($Position as $position) { |
46 | 47 | $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> |
... | ... | @@ -74,12 +75,12 @@ class MainController extends Controller |
74 | 75 | selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> |
75 | 76 | where('categories.is_remove', '=', '0')-> |
76 | 77 | where('job_titles.is_remove', '=', '0')-> |
78 | + where('job_titles.is_bd', '=' , '0')-> | |
77 | 79 | leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> |
78 | 80 | join('categories', 'categories.id', '=', 'job_titles.position_id')-> |
79 | 81 | groupBy('job_titles.id')->orderByDesc('job_titles.position_id')-> |
80 | 82 | orderByDesc('job_titles.sort')->get()->toArray(); |
81 | 83 | |
82 | - | |
83 | 84 | $Main_Job = array(); |
84 | 85 | $name_cat = ''; |
85 | 86 | foreach ($Data as $it) { |
... | ... | @@ -193,6 +194,7 @@ class MainController extends Controller |
193 | 194 | $Data = DB::table('job_titles')-> |
194 | 195 | selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> |
195 | 196 | where('categories.is_remove', '=', '0')-> |
197 | + where('job_titles.is_bd', '=' , '0')-> | |
196 | 198 | where('job_titles.is_remove', '=', '0'); |
197 | 199 | if (($request->has('job')) && ($request->get('job') > 0)) { |
198 | 200 | $Data = $Data->where('job_title_id', $request->get('job')); |
app/Http/Controllers/WorkerController.php
... | ... | @@ -229,7 +229,9 @@ class WorkerController extends Controller |
229 | 229 | function (Builder $query) use ($id) {$query->Where('id', $id); |
230 | 230 | })->get(); |
231 | 231 | |
232 | - $Job_titles = Job_title::query()->where('is_remove', '=', '0')->OrderBy('name')->get(); | |
232 | + $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> | |
233 | + where('is_bd', '=' , '1')-> | |
234 | + OrderBy('name')->get(); | |
233 | 235 | $Infoblocks = infobloks::query()->OrderBy('name')->get(); |
234 | 236 | |
235 | 237 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
resources/views/admin/job_titles/form.blade.php
... | ... | @@ -59,9 +59,9 @@ |
59 | 59 | |
60 | 60 | <select name="is_bd" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" |
61 | 61 | title="Видимость"> |
62 | - <option value="0" @if (isset($job_title)) @if ($job_title->is_bd == 0) selected @endif @endif>База данных</option> | |
63 | - <option value="1" @if (isset($job_title)) @if ($job_title->is_bd == 1) selected @endif @endif>База резюме</option> | |
64 | - <option value="2" @if (isset($job_title)) @if ($job_title->is_bd == 2) selected @endif @endif>Везде инфа</option> | |
62 | + <option value="0" @if (isset($job_title)) @if ($job_title->is_bd == 0) selected @endif @endif>Работодатель</option> | |
63 | + <option value="1" @if (isset($job_title)) @if ($job_title->is_bd == 1) selected @endif @endif>Работник</option> | |
64 | + <option value="2" @if (isset($job_title)) @if ($job_title->is_bd == 2) selected @endif @endif>База данных</option> | |
65 | 65 | </select> |
66 | 66 | </label><br> |
67 | 67 |
resources/views/admin/job_titles/index.blade.php
... | ... | @@ -43,10 +43,10 @@ |
43 | 43 | </td> |
44 | 44 | <td class="px-4 py-3 text-xs"> |
45 | 45 | @switch ($job->is_bd) |
46 | - @case (0) База данных @break | |
47 | - @case (1) База резюме @break | |
48 | - @case (2) Везде @break | |
49 | - @default Везде @break | |
46 | + @case (0) Работодатель @break | |
47 | + @case (1) Работник @break | |
48 | + @case (2) База данных @break | |
49 | + @default База данных @break | |
50 | 50 | @endswitch |
51 | 51 | </td> |
52 | 52 | <td class="px-4 py-3 text-xs"> |