Commit 71759e16767aa75428cffd8daec7b3bed2f4af1b

Authored by Fedor K
Exists in master

Merge branch 'task-132985' into 'master'

task-132985 minor fixes

Showing 7 changed files Side-by-side Diff

app/Console/Commands/DispatchResumeLiftJobCommand.php
... ... @@ -2,6 +2,7 @@
2 2  
3 3 namespace App\Console\Commands;
4 4  
  5 +use App\Jobs\LiftResumeJob;
5 6 use App\Jobs\LiftVacancyJob;
6 7 use App\Jobs\SendVacancyToTelegramJob;
7 8 use App\Models\EmployerAutoliftOption;
... ... @@ -39,7 +40,7 @@ class DispatchResumeLiftJobCommand extends Command
39 40 })
40 41 ->get();
41 42  
42   - LiftVacancyJob::dispatch($workers->pluck('worker_id')->toArray());
  43 + LiftResumeJob::dispatch($workers->pluck('worker_id')->toArray());
43 44  
44 45 return Command::SUCCESS;
45 46 }
app/Http/Controllers/EmployerController.php
... ... @@ -264,9 +264,10 @@ class EmployerController extends Controller
264 264 // Сохранение-редактирование записи
265 265 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
266 266 $params = $request->all();
267   - $params_job["job_title_id"] = $params['job_title_id'];
268 267  
269 268 $ad_employer->update($params);
  269 + $ad_employer->active_is = 1;
  270 + $ad_employer->save();
270 271 $ad_employer->jobs()->sync($request->get('job_title_id'));
271 272  
272 273 $id = Auth()->user()->id;
... ... @@ -811,7 +812,7 @@ class EmployerController extends Controller
811 812 'employer_id' => $employer->id,
812 813 ],
813 814 [
814   - 'is_enabled' => $request->get('is_enabled') === 'on',
  815 + 'is_enabled' => $request->get('is_enabled') === 'true',
815 816 'times_per_day' => $request->get('times_per_day'),
816 817 'days_repeat' => $request->get('days_repeat'),
817 818 'time_send_first' => $request->get('time_send_first'),
app/Http/Controllers/WorkerController.php
... ... @@ -1111,7 +1111,7 @@ class WorkerController extends Controller
1111 1111 'worker_id' => $worker->id,
1112 1112 ],
1113 1113 [
1114   - 'is_enabled' => $request->get('is_enabled') === 'on',
  1114 + 'is_enabled' => $request->get('is_enabled') === 'true',
1115 1115 'times_per_day' => $request->get('times_per_day'),
1116 1116 'days_repeat' => $request->get('days_repeat'),
1117 1117 'time_send_first' => $request->get('time_send_first'),
app/Jobs/LiftVacancyJob.php
... ... @@ -23,7 +23,7 @@ class LiftVacancyJob implements ShouldQueue
23 23 public function handle()
24 24 {
25 25 Ad_employer::query()
26   - ->whereIn('id', $this->employerIds)
  26 + ->whereIn('employer_id', $this->employerIds)
27 27 ->update([
28 28 'updated_at' => now()
29 29 ]);
app/Jobs/SendVacancyToTelegramJob.php
... ... @@ -30,7 +30,7 @@ class SendVacancyToTelegramJob implements ShouldQueue
30 30 public function handle(): void
31 31 {
32 32 $vacancies = Ad_employer::query()
33   - ->whereIn('id', $this->employerIds)
  33 + ->whereIn('employer_id', $this->employerIds)
34 34 ->get();
35 35  
36 36 foreach ($vacancies as $vacancy) {
resources/views/employers/edit_vacancy.blade.php
... ... @@ -121,34 +121,6 @@
121 121 @enderror
122 122 </div>
123 123 </div>
124   - <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="">
125   - <label class="form-group__label">Категория (локация)</label>
126   - <div class="form-group__item">
127   - <div class="select">
128   - <select class="js-select2" name="category_id" id="category_id">
129   - php $i = 1 endphp
130   - if ($Positions->count())
131   - foreach($Positions as $j)
132   - if ($i == 1) <option> Выберите категорию из списка</option>
133   - else
134   - <option value=" $j->id }}" if ($ad_employer->category_id == $j->id) selected endif>$j->name }}</option>
135   - endif
136   - php $i++ endphp
137   - endforeach
138   - endif
139   - </select>
140   - error('category_id')
141   - <span class="text-xs text-red-600 dark:text-red-400">
142   - $message }}
143   - </span>
144   - enderror
145   - </div>
146   - </div>
147   - </div>-->
148   -
149   - <!--foreach ($ad_employer->jobs_code as $it_um)
150   - <pre> print_r($it_um) }}</pre>
151   - endforeach-->
152 124 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
153 125 <label class="form-group__label">Редактирование должностей</label>
154 126 <div class="form-group__item">
... ... @@ -184,29 +156,10 @@
184 156 @enderror
185 157 </div>
186 158 </div>
187   -
188   - <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
189   - <h4 class="form-group__label">Редактирование должностей</h4>
190   - <div class="form-group__item">
191   - <a href=" route('employer.add_job_in_vac', ['ad_employer' => $ad_employer->id]) }}" class="button">Добавить</a>
192   -
193   - if ($ad_employer->jobs->count())
194   - foreach ($ad_employer->jobs as $key => $it_um)
195   - <p>if (isset($ad_employer->jobs_code[$key]))
196   - <a href=" route('employer.edit_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id, 'ad_employer' => $ad_employer->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">$it_um->name}}</a>
197   - <a href=" route('employer.delete_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
198   - endif
199   - </p>
200   - endforeach
201   - else
202   - Нет связанных <br> с вакансией должностей
203   - endif
204   - </div>
205   - </div>-->
206 159 </div>
207 160  
208 161 <a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a>
209   - <button type="submit" class="button cabinet__submit">Опубликовать</button>
  162 + <button type="submit" class="button cabinet__submit">Сохранить и опубликовать</button>
210 163 </div>
211 164 </form>
212 165 </div>
resources/views/modals/send_worker.blade.php
... ... @@ -6,13 +6,10 @@
6 6 });
7 7  
8 8 $(document).on('change', '#btn_send_file', function() {
9   -
10   - var send_name = $('#send_name');
11   - var send_name_val = send_name.val();
12   - var send_name_file = $('#send_name_file');
13   -
14   - send_name_file.html(send_name_val);
15   -
  9 + let dirArray = $(this).val().split('\\')
  10 + console.log(dirArray)
  11 + $('#send_name_file3').html(dirArray[dirArray.length - 1])
  12 + console.log($('#send_name_file3').html())
16 13 });
17 14 </script>
18 15 <div id="send3" class="modal">
... ... @@ -29,8 +26,8 @@
29 26 </div>
30 27 <div class="modal__form-item">
31 28 <div class="file">
32   - <label class="file__input" id="btn_send_file" name="btn_send_file">
33   - <input type="file" name="file" id="send_name">
  29 + <label class="file__input">
  30 + <input type="file" name="file" id="btn_send_file">
34 31 <span class="button button_light">
35 32 <svg>
36 33 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
... ... @@ -45,7 +42,7 @@
45 42 <svg>
46 43 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
47 44 </svg>
48   - <span id="send_name_file" name="send_name_file"></span>
  45 + <span id="send_name_file3"></span>
49 46 </div>
50 47 <button type="button" class="file__list-item-right js-parent-remove">
51 48 <svg>