Commit 415bebd6cdda18267f88887f3471bd271fb5c0c8

Authored by Андрей Ларионов
1 parent 7a610b20ea

Баг с избранными людьми

Showing 3 changed files with 11 additions and 6 deletions Side-by-side Diff

app/Http/Controllers/EmployerController.php
... ... @@ -563,6 +563,8 @@ class EmployerController extends Controller
563 563 }
564 564  
565 565 $Workers = $Workers->get();
  566 +
  567 +
566 568 return view('employers.favorite', compact('Workers'));
567 569 }
568 570  
app/Http/Controllers/MainController.php
... ... @@ -108,10 +108,9 @@ class MainController extends Controller
108 108  
109 109 if ($request->has('code_record')) {
110 110 if ($request->has('delete')) {
  111 + $code = $request->get('code_record');
111 112 $atomic_era = Like_vacancy::select('id')->
112   - where('code_record', '=', $request->
113   - get('code_record'))->first();
114   -
  113 + where('code_record', '=', $code)->toSql();
115 114 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete();
116 115  
117 116 } else {
resources/views/employers/favorite.blade.php
... ... @@ -46,7 +46,7 @@
46 46 });
47 47 });
48 48 </script>
49   - @include('js.favorite-vacancy-45')
  49 + @include('js.favorite-worker')
50 50 @endsection
51 51  
52 52 @section('content')
... ... @@ -104,7 +104,7 @@
104 104 @foreach ($Workers as $it)
105 105 <div class="cvs__body">
106 106 <div class="cvs__item">
107   - <button type="button" data-val="{{ $it->id }}" class="like cvs__item-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_worker($it) }}">
  107 + <button type="button" id="elem_{{ $it->id }}" data-val="{{ $it->id }}" class="like cvs__item-like js_box_favorit js-toggle {{ \App\Classes\LikesClass::get_status_worker($it) }}">
108 108 <svg>
109 109 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
110 110 </svg>
... ... @@ -113,7 +113,11 @@
113 113 <svg>
114 114 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
115 115 </svg>
116   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  116 + @if (!empty($it->photo))
  117 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($it->photo)) }}" alt="">
  118 + @else
  119 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  120 + @endif
117 121 </div>
118 122 <div class="cvs__item-text">
119 123 <div>