Commit 2702c67a9c390920f7039b5185b1d7acb10bd294

Authored by Андрей Ларионов
1 parent 24b5f80e87

Коммит по субботе

Showing 11 changed files with 105 additions and 47 deletions Side-by-side Diff

app/Http/Controllers/EmployerController.php
... ... @@ -165,7 +165,10 @@ class EmployerController extends Controller
165 165 if (Auth()->user()->is_public) {
166 166 $categories = Category::query()->active()->get();
167 167  
168   - $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->where('is_bd', '=', '0')->get();
  168 + $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
  169 + where('is_remove', '=', '0')->
  170 + where('is_bd', '=', '0')->
  171 + get();
169 172 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
170 173  
171 174 WhereHas('users',
... ... @@ -316,7 +319,7 @@ class EmployerController extends Controller
316 319 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
317 320 }
318 321  
319   - $answer = $answer->with('response')->get();
  322 + $answer = $answer->with('response')->OrderByDESC('id')->get();
320 323  
321 324 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
322 325 }
app/Http/Controllers/MainController.php
... ... @@ -39,8 +39,9 @@ class MainController extends Controller
39 39 ->GroupBy('categories.id')
40 40 ->get();
41 41  
42   - $Position = Category::query()->where('is_remove', '=', '0')->get();
43   - $job_titles = Job_title::query()->where('is_remove', '=', 0)->get();
  42 + //$Position = Category::query()->where('is_remove', '=', '0')->get();
  43 + $Job_title = Job_title::query()->where('is_remove', '=', '0')->
  44 + where('is_bd', '=', '0')->orderBy('name')->get();
44 45  
45 46 /*$BigFlot = Array();
46 47 foreach ($Position as $position) {
... ... @@ -78,7 +79,7 @@ class MainController extends Controller
78 79 where('job_titles.is_bd', '=' , '0')->
79 80 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
80 81 join('categories', 'categories.id', '=', 'job_titles.position_id')->
81   - groupBy('job_titles.id')->orderByDesc('job_titles.position_id')->
  82 + groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
82 83 orderByDesc('job_titles.sort')->get()->toArray();
83 84  
84 85 $Main_Job = array();
... ... @@ -91,7 +92,7 @@ class MainController extends Controller
91 92  
92 93 $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get();
93 94 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
94   - return view('index', compact('news', 'job_titles', 'categories', 'employers', 'vacancy', 'Main_Job'));
  95 + return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job'));
95 96 }
96 97  
97 98 public function search_vacancies(Request $request) {
... ... @@ -147,7 +148,8 @@ class MainController extends Controller
147 148  
148 149 public function vacancies(Request $request) {
149 150 //должности
150   - $Job_title = Job_title::query()->where('is_remove', '=', '0')->orderBy('name')->get();
  151 + $Job_title = Job_title::query()->where('is_remove', '=', '0')->
  152 + where('is_bd', '=', '0')->orderBy('name')->get();
151 153  
152 154 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
153 155 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
... ... @@ -201,7 +203,7 @@ class MainController extends Controller
201 203 }
202 204 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
203 205 join('categories', 'categories.id', '=', 'job_titles.position_id')->
204   - groupBy('job_titles.id')->orderByDesc('job_titles.position_id')->
  206 + groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
205 207 orderByDesc('job_titles.sort')->get()->toArray();
206 208  
207 209 $Main_Job = array();
... ... @@ -261,7 +263,7 @@ class MainController extends Controller
261 263 }
262 264 }
263 265  
264   - $Job_title = Job_title::query()->OrderBy('name')->get();
  266 + $Job_title = Job_title::query()->where('is_bd', '=', '0')->OrderBy('name')->get();
265 267  
266 268 $Query_count = $Query->count();
267 269  
app/Http/Controllers/WorkerController.php
... ... @@ -244,7 +244,7 @@ class WorkerController extends Controller
244 244  
245 245 $Job_titles = Job_title::query()->where('is_remove', '=', '0')->
246 246 where('is_bd', '=' , '1')->
247   - OrderBy('name')->get();
  247 + OrderByDesc('sort')->OrderBy('name')->get();
248 248 $Infoblocks = infobloks::query()->OrderBy('name')->get();
249 249  
250 250 $stat = Static_worker::query()->where('year_month', '=', $get_date)
... ... @@ -878,6 +878,7 @@ class WorkerController extends Controller
878 878 $message->to_user_id = $params['send_to_user_id'];
879 879 $message->title = $params['send_title'];
880 880 $message->text = $params['send_text'];
  881 + $message->ad_employer_id = $params['send_vacancy'];
881 882 if ($request->has('send_file')) {
882 883 $message->file = $request->file('send_file')->store("worker/$id", 'public');
883 884 }
resources/views/employers/add_vacancy.blade.php
... ... @@ -75,6 +75,32 @@
75 75 </div>
76 76 </div>
77 77  
  78 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  79 + <label class="form-group__label">Добавление должностей</label>
  80 + <div class="form-group__item">
  81 + <div class="select">
  82 + <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
  83 + @php $i = 1 @endphp
  84 + @if ($jobs->count())
  85 + @foreach($jobs as $it)
  86 + @php $selected = false; @endphp
  87 + @if (isset($Worker[0]->job_titles))
  88 + @if ($Worker[0]->job_titles->count())
  89 + @foreach($Worker[0]->job_titles as $select)
  90 + @if ($it->id == $select->id)
  91 + @php $selected = true; @endphp
  92 + @endif
  93 + @endforeach
  94 + @endif
  95 + @endif
  96 + <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option>
  97 + @endforeach
  98 + @endif
  99 + </select>
  100 + </div>
  101 + </div>
  102 + </div>
  103 +
78 104 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
79 105 <label class="form-group__label">Телефон</label>
80 106 <div class="form-group__item">
... ... @@ -148,7 +174,7 @@
148 174 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
149 175 <label class="form-group__label">Описание вакансии</label>
150 176 <div class="form-group__item">
151   - <textarea class="textarea" name="text" id="text">{{ old('text') ?? '' }}</textarea>
  177 + <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? '' }}</textarea>
152 178 @error('text')
153 179 <span class="text-xs text-red-600">
154 180 {{ $message }}
... ... @@ -160,7 +186,7 @@
160 186 </div>
161 187  
162 188 <div class="cabinet__body-item">
163   - <div class="cabinet__body-item">
  189 + <!-- <div class="cabinet__body-item">
164 190 <div class="cabinet__descr">
165 191 <p class="cabinet__text"><b>Добавление должности</b></p>
166 192 </div>
... ... @@ -192,29 +218,7 @@
192 218 </div>-->
193 219  
194 220 <div class="cabinet__inputs-item cabinet__inputs-item_max form-group">
195   - <label class="form-group__label">Добавление должностей</label>
196   - <div class="form-group__item">
197   - <div class="select">
198   - <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
199   - @php $i = 1 @endphp
200   - @if ($jobs->count())
201   - @foreach($jobs as $it)
202   - @php $selected = false; @endphp
203   - @if (isset($Worker[0]->job_titles))
204   - @if ($Worker[0]->job_titles->count())
205   - @foreach($Worker[0]->job_titles as $select)
206   - @if ($it->id == $select->id)
207   - @php $selected = true; @endphp
208   - @endif
209   - @endforeach
210   - @endif
211   - @endif
212   - <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option>
213   - @endforeach
214   - @endif
215   - </select>
216   - </div>
217   - </div>
  221 +
218 222 </div>
219 223  
220 224 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
... ... @@ -330,4 +334,14 @@
330 334 </div>
331 335 </section>
332 336 </div>
  337 + <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
  338 + <script>
  339 + CKEDITOR.replace('text');
  340 + //CKEDITOR.replace( 'text', {
  341 + // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
  342 + // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
  343 + // filebrowserUploadMethod: 'form'
  344 + // });
  345 + </script>
  346 +
333 347 @endsection
resources/views/employers/ajax/list_vacancy.blade.php
... ... @@ -7,7 +7,7 @@
7 7 <th>№</th>
8 8 <th>Название</th>
9 9 <th>Дата добавления<br>/&nbsp;обновления</th>
10   - <th>Должности</th>
  10 + <th style="display:none">Должности</th>
11 11 <th>Статус</th>
12 12 <th>Действия</th>
13 13 </tr>
... ... @@ -18,7 +18,7 @@
18 18 <td>{{ $it->id }}</td>
19 19 <td>{{ $it->name }}</td>
20 20 <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td>
21   - <td> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>
  21 + <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>
22 22  
23 23 @if ($it->jobs->count())
24 24 @foreach ($it->jobs as $key => $it_um)
resources/views/employers/cabinet45.blade.php
... ... @@ -165,4 +165,14 @@
165 165 </section>
166 166 </div>
167 167 <!-- END TOP WRAPPER -->
  168 + <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
  169 + <script>
  170 + CKEDITOR.replace('txtarea');
  171 + //CKEDITOR.replace( 'text', {
  172 + // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
  173 + // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
  174 + // filebrowserUploadMethod: 'form'
  175 + // });
  176 + </script>
  177 +
168 178 @endsection
resources/views/employers/edit_vacancy.blade.php
... ... @@ -149,7 +149,7 @@
149 149 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
150 150 <label class="form-group__label">Описание вакансии</label>
151 151 <div class="form-group__item">
152   - <textarea class="textarea" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea>
  152 + <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea>
153 153 @error('text')
154 154 <span class="text-xs text-red-600">
155 155 {{ $message }}
... ... @@ -186,4 +186,13 @@
186 186 </div>
187 187 </section>
188 188 </div>
  189 + <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
  190 + <script>
  191 + CKEDITOR.replace('text');
  192 + //CKEDITOR.replace( 'text', {
  193 + // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
  194 + // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
  195 + // filebrowserUploadMethod: 'form'
  196 + // });
  197 + </script>
189 198 @endsection
resources/views/employers/list_answer.blade.php
... ... @@ -170,8 +170,12 @@
170 170 </div>
171 171 </div>
172 172 @endforeach
  173 +
  174 + <!-- $it->response->appends($_GET)->links('paginate') -->
173 175 @endif
174 176 @endforeach
  177 +
  178 +
175 179 @else
176 180 <div class="notify">
177 181 <svg>
resources/views/employers/list_vacancy.blade.php
... ... @@ -87,7 +87,7 @@
87 87 <th>№</th>
88 88 <th>Название</th>
89 89 <th>Дата добавления<br>/&nbsp;обновления</th>
90   - <th>Должности</th>
  90 + <th style="display:none">Должности</th>
91 91 <th>Статус</th>
92 92 <th>Действия</th>
93 93 </tr>
... ... @@ -98,7 +98,7 @@
98 98 <td>{{ $it->id }}</td>
99 99 <td>{{ $it->name }}</td>
100 100 <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td>
101   - <td> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>
  101 + <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>
102 102  
103 103 @if ($it->jobs->count())
104 104 @foreach ($it->jobs as $key => $it_um)
resources/views/index.blade.php
... ... @@ -23,6 +23,21 @@
23 23 </div>
24 24 <form class="search work__form" action="{{ route('search_vacancies') }}" method="GET">
25 25 <input type="search" id="search" name="search" class="input" placeholder="Желаемая должность" required>
  26 + <!--<div class="select select_search thing__select">
  27 + <div class="select__icon">
  28 + <svg>
  29 + <use xlink:href=" asset('images/sprite.svg#search') }}"></use>
  30 + </svg>
  31 + </div>
  32 + <select class="js-select2 jobs" id="search" name="search">
  33 + <option value="0">Выберите должность</option>
  34 + if ($Job_title->count())
  35 + foreach($Job_title as $JT)
  36 + <option value=" $JT->id }}" if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected endif> $JT->name }}</option>
  37 + endforeach
  38 + endif
  39 + </select>
  40 + </div>-->
26 41 <button type="submit" class="button button_light">Посмотреть вакансии</button>
27 42 <span>
28 43 <svg>
resources/views/modals/send_worker_new.blade.php
... ... @@ -37,16 +37,16 @@
37 37 <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required>
38 38 <label for="title">Не заполнено поле</label>
39 39 </div>
40   - <div class="modal__form-item send_title_div error_">
  40 + <!--<div class="modal__form-item send_title_div error_">
41 41 <select class="js-select2" name="send_job_title_id" id="send_job_title_id">
42   - @if ($jobs->count())
43   - @foreach($jobs as $j)
44   - <option value="{{ $j->id }}">{{ $j->name }} ({{ $j->id }})</option>
45   - @endforeach
46   - @endif
  42 + if ($jobs->count())
  43 + foreach($jobs as $j)
  44 + <option value=" $j->id }}"> $j->name }} ( $j->id }})</option>
  45 + endforeach
  46 + endif
47 47 </select>
48 48 <label for="title">Не заполнено поле</label>
49   - </div>
  49 + </div>-->
50 50 <div class="modal__form-item send_text_div">
51 51 <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Напишите текст с предложением о работе" required></textarea>
52 52 <label for="i2">Не заполнено поле</label>