Commit 7cc82d4c7efaa57d880f086226689022737ea6ff

Authored by Fedor K
Exists in master

Merge branch 'task-132687' into 'master'

task-132687 minor changes

Showing 14 changed files Side-by-side Diff

app/Classes/LikesClass.php
... ... @@ -31,7 +31,7 @@ class LikesClass
31 31 }
32 32  
33 33 public static function get_status_vacancy(Ad_employer $ad_employer) {
34   - $isVacancyLiked = Like_worker::query()
  34 + $isVacancyLiked = Like_vacancy::query()
35 35 ->where('code_record', $ad_employer->id)
36 36 ->where('user_id', Auth::user()?->id)
37 37 ->exists();
app/Http/Controllers/Admin/UsersController.php
... ... @@ -80,8 +80,7 @@ class UsersController extends Controller
80 80 }
81 81  
82 82 public function add_store_bd(BaseUserRequest $request) {
83   - $params = $request->all();
84   - $positions_work = json_encode($request->input('positions_work', []));
  83 + $params = $request->all();
85 84  
86 85 if ($request->has('file')) {
87 86 $params['file'] = $request->file('file')->store('basedata', 'public');
... ... @@ -92,10 +91,10 @@ class UsersController extends Controller
92 91 }
93 92  
94 93 $user = User::create($params);
95   - $user_id = $user->id;
96 94 $worker = new Worker();
97   - $worker->positions_work = $positions_work;
98   - $worker->user_id = $user_id;
  95 + $worker->positions_work = isset($params['positions_work']) ? json_encode($params['positions_work']) : [];
  96 + $worker->user_id = $user->id;
  97 + $worker->comment = isset($params['comment']) ? $params['comment'] : null;
99 98 $worker->save();
100 99  
101 100 return redirect()->route('admin.basedata');
... ... @@ -126,11 +125,13 @@ class UsersController extends Controller
126 125 if (isset($user->workers[0]->id)) {
127 126 $worker = Worker::find($user->workers[0]->id);
128 127 $worker->positions_work = $positions_work;
  128 + $worker->comment = isset($params['comment']) ? $params['comment'] : null;
129 129 $worker->save();
130 130 } else {
131 131 $worker = new Worker();
132 132 $worker->user_id = $user->id;
133 133 $worker->positions_work = $positions_work;
  134 + $worker->comment = isset($params['comment']) ? $params['comment'] : null;
134 135 $worker->save();
135 136 }
136 137  
app/Http/Controllers/EmployerController.php
... ... @@ -571,7 +571,7 @@ class EmployerController extends Controller
571 571 $users = $users->Baseuser()->
572 572 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id'));
573 573 $count_users = $users;
574   - $users = $users->paginate(5);
  574 + $users = $users->paginate(10);
575 575  
576 576 $export_options = DbExportColumns::toArray();
577 577  
app/Http/Controllers/WorkerController.php
... ... @@ -247,7 +247,8 @@ class WorkerController extends Controller
247 247 $status_work = WorkerStatuses::getWorkerStatuses();
248 248 $infoblocks = infobloks::query()->get();
249 249  
250   - //return view('layout.pdf', compact('Query', 'status_work', 'infoblocks'));
  250 + //dd($Query[0]);
  251 + return view('layout.pdf', compact('Query', 'status_work', 'infoblocks'));
251 252 $pdf = PDF::loadView('layout.pdf', [
252 253 'Query' => $Query,
253 254 'status_work' => $status_work,
... ... @@ -725,8 +726,10 @@ class WorkerController extends Controller
725 726  
726 727 // Вакансии избранные
727 728 public function colorado(Request $request) {
728   - $IP_address = RusDate::ip_addr_client();
729   - $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
  729 + $Arr = Like_vacancy::Query()
  730 + ->select('code_record')
  731 + ->where('user_id', Auth::user()->id)
  732 + ->get();
730 733  
731 734 if ($Arr->count()) {
732 735 $A = Array();
app/Models/Worker.php
... ... @@ -55,7 +55,8 @@ class Worker extends Model
55 55 'visa_available',
56 56 'tanker_documents_available',
57 57 'confirmation_work_for_vvp',
58   - 'military_id_available'
  58 + 'military_id_available',
  59 + 'comment'
59 60 ];
60 61  
61 62 /**
... ... @@ -113,7 +114,12 @@ class Worker extends Model
113 114  
114 115 //Связь Работника с инфоблоками (0-0 - 0-0)
115 116 public function infobloks() {
116   - return $this->belongsToMany(infobloks::class,'dop_info', 'worker_id', 'infoblok_id');
  117 + return $this->belongsToMany(
  118 + infobloks::class,
  119 + 'dop_info',
  120 + 'worker_id',
  121 + 'infoblok_id'
  122 + )->withPivot('status');
117 123 }
118 124  
119 125 //Связи Работника с дополнительными
database/migrations/2024_10_07_073601_add_comment_to_workers_table.php
... ... @@ -0,0 +1,32 @@
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +return new class extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::table('workers', function (Blueprint $table) {
  17 + $table->string('comment')->nullable();
  18 + });
  19 + }
  20 +
  21 + /**
  22 + * Reverse the migrations.
  23 + *
  24 + * @return void
  25 + */
  26 + public function down()
  27 + {
  28 + Schema::table('workers', function (Blueprint $table) {
  29 + $table->dropColumn('comment');
  30 + });
  31 + }
  32 +};
resources/views/admin/users/form.blade.php
... ... @@ -101,6 +101,19 @@
101 101 </label><br>
102 102  
103 103 <label class="block text-sm">
  104 + <span class="text-gray-700 dark:text-gray-400">Комментарий</span>
  105 + <input name="comment" id="comment"
  106 + class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
  107 + placeholder="Комментарий" value="{{ old('comment') ?? $user->comment ?? '' }}"
  108 + />
  109 + @error('telephone')
  110 + <span class="text-xs text-red-600 dark:text-red-400">
  111 + {{ $message }}
  112 + </span>
  113 + @enderror
  114 + </label><br>
  115 +
  116 + <label class="block text-sm">
104 117 <span class="text-gray-700 dark:text-gray-400">Файл-анкета</span>
105 118 <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700
106 119 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple
resources/views/employers/bd.blade.php
... ... @@ -146,6 +146,7 @@
146 146 <table>
147 147 <thead>
148 148 <tr>
  149 + <th style="max-width: 40px; min-width: 30px"></th>
149 150 <th>ФИО соискателя</th>
150 151 <th>Должность</th>
151 152 <th>Наличие<br>анкеты</th>
... ... @@ -160,6 +161,8 @@
160 161 @if ($users->count())
161 162 @foreach ($users as $key => $it)
162 163 <tr>
  164 + <td style="max-width: 40px; min-width: 30px; font-size: 3rem">{{ $it->workers[0]->comment }}</td>
  165 +
163 166 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td>
164 167  
165 168 <td>
resources/views/employers/dialog.blade.php
... ... @@ -177,10 +177,10 @@
177 177 @endif
178 178 </div>
179 179 <div class="chatbox__item-body">
180   - @if($it->text || $it->reply_message_id)
  180 + @if($it->text || $it->reply_message_id || $it->ad_employer_id > 0)
181 181 <div class="chatbox__item-text">
182 182 @if($it->ad_employer_id > 0)
183   - <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br>
  183 + <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)?->name }}"<br>
184 184 @if($it->text)
185 185 <b>Комментарий:</b> {{ $it->text }}
186 186 @endif
resources/views/employers/list_vacancy.blade.php
... ... @@ -122,36 +122,36 @@
122 122 </td>
123 123 <td>
124 124 <span class="table__controls">
125   - <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}">
  125 + <a class="table__controls-item up-it" title="Поднять вакансию" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}">
126 126 <svg>
127 127 <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use>
128 128 </svg>
129 129 </a>
130   - <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item">
  130 + <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" title="Редактировать вакансию" class="table__controls-item">
131 131 <svg>
132 132 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
133 133 </svg>
134 134 </a>
135   - <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}">
  135 + <a class="table__controls-item" title="Удалить вакансию" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}">
136 136 <svg>
137 137 <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use>
138 138 </svg>
139 139 </a>
140 140 @if ($it->active_is)
141   - <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item">
  141 + <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" title="Скрыть вакансию" class="table__controls-item">
142 142 <svg>
143 143 <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
144 144 </svg>
145 145 </a>
146 146 @else
147   - <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item">
  147 + <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" title="Показать вакансию" class="table__controls-item">
148 148 <svg>
149 149 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
150 150 </svg>
151 151 </a>
152 152 @endif
153 153 @if ($Employer->social_is == 1)
154   - <a href="{{ route('employer.send-vacancy-to-social', ['social' => 'tg', 'vacancy' => $it->id]) }}" class="table__controls-item">
  154 + <a href="{{ route('employer.send-vacancy-to-social', ['social' => 'tg', 'vacancy' => $it->id]) }}" title="Отправить вакансию в телеграм" class="table__controls-item">
155 155 <svg>
156 156 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
157 157 </svg>
resources/views/index.blade.php
... ... @@ -102,11 +102,19 @@
102 102 @foreach($employers as $emp)
103 103 @if (!empty($emp->employer->logo))
104 104 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}">
105   - <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}">
  105 + <img
  106 + src="{{ asset(Storage::url($emp->employer->logo)) }}"
  107 + alt="{{ $emp->employer->name_company }}"
  108 + title="{{ $emp->employer->name_company }}"
  109 + >
106 110 </a>
107 111 @else
108 112 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}">
109   - <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}">
  113 + <img
  114 + src="{{ asset('images/logo_emp.png') }}"
  115 + alt="{{ $emp->employer->name_company }}"
  116 + title="{{ $emp->employer->name_company }}"
  117 + >
110 118 </a>
111 119 @endif
112 120 @endforeach
resources/views/layout/frontend.blade.php
... ... @@ -52,18 +52,6 @@
52 52 </nav>
53 53 </div>
54 54 <div class="header__right">
55   - @guest
56   -
57   - @else
58   - <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif"
59   - class="header__notifs header__notifs_actived">
60   - <svg>
61   - <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use>
62   - </svg>
63   - <span>Уведомления</span>
64   - </a>
65   -
66   - @endguest
67 55 <div class="header__right-line"></div>
68 56 <button class="header__burger">
69 57 <svg>
... ... @@ -74,7 +62,11 @@
74 62 <a class="button header__sign" data-fancybox data-src="#sign"
75 63 data-options='{"touch":false,"autoFocus":false}'>Войти</a>
76 64 @else
77   - <a class="button header__sign" href="{{ route('logout') }}">Выйти</a>
  65 + <a
  66 + class="button header__sign"
  67 + href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif">
  68 + Личный кабинет
  69 + </a>
78 70 @endguest
79 71 </div>
80 72 </div>
... ... @@ -316,12 +308,13 @@
316 308 <!-- Подверждение об удалении профиля -->
317 309 @include('modals.success_delete_profile')
318 310  
319   - @include('modals.vacancy.ask_user_to_complete_profile')
320   - @include('modals.vacancy.ask_for_resume_comment')
321 311 @include('modals.vacancy.add_comment')
  312 + @include('modals.vacancy.ask_for_resume_comment')
  313 + @include('modals.vacancy.ask_user_to_complete_profile')
  314 + @include('modals.vacancy.favorite_noaut')
  315 + @include('modals.vacancy.send_response_no_comment')
322 316 @include('modals.vacancy.send_response_to_employer')
323 317 @include('modals.vacancy.tell_user_to_complete_profile')
324   - @include('modals.vacancy.favorite_noaut')
325 318  
326 319 </div> <!-- END MODALS WRAPPER -->
327 320  
resources/views/layout/pdf.blade.php
... ... @@ -311,18 +311,18 @@ $worker = $Query[0];
311 311 @if ($Query[0]->infobloks->count())
312 312  
313 313 @foreach($Query[0]->infobloks as $it)
314   - @if ($info->id == $it->id)
315   - <tr>
316   - <td><b>{{ $it->name }}</b></td>
317   - <td>
318   - @if ($it->model_dop_info[0]->status == 0) Не указано
319   - @elseif($it->model_dop_info[0]->status==1) В наличии
320   - @else Отсутствует
321   - @endif
322   - </td>
323   - </tr>
324   - @php $finder = true; @endphp
325   - @endif
  314 + @if ($info->id == $it->id)
  315 + <tr>
  316 + <td><b>{{ $it->name }}</b></td>
  317 + <td>
  318 + @if ($it->pivot->status == 0) Не указано
  319 + @elseif($it->pivot->status==1) В наличии
  320 + @else Отсутствует
  321 + @endif
  322 + </td>
  323 + </tr>
  324 + @php $finder = true; @endphp
  325 + @endif
326 326 @endforeach
327 327 @endif
328 328 @endif
resources/views/list_vacancies.blade.php
... ... @@ -226,7 +226,7 @@
226 226 @else
227 227 @if (App\Classes\StatusUser::Status() == 1)
228 228 <?php
229   - if (\App\Classes\Tools::getWorkerProfilePercent(Auth()->user()->workers[0]) > 50) {
  229 + if (\App\Classes\Tools::getWorkerProfilePercent(Auth()->user()->workers[0]) >= 50) {
230 230 $buttonId = 'ask_comment';
231 231 } else {
232 232 $buttonId = 'ask_percent';
... ... @@ -262,7 +262,10 @@
262 262 </svg>
263 263 </button>
264 264 @else
265   - <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
  265 + <button type="button"
  266 + id="like{{ $Q->id }}"
  267 + data-val="{{ $Q->id }}"
  268 + class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
266 269 <svg>
267 270 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
268 271 </svg>