diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index a0a237b..f9e5797 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -333,12 +333,16 @@ class EmployerController extends Controller //Избранные люди public function favorites(Request $request) { - $items = RusDate::count_item_fav(); - $it = $_COOKIE['favorite_worker']; - $it = str_replace('"', "", $it); - $it = str_replace('[', "", $it); - $it = str_replace(']', "", $it); - $Arr = explode(",", $it); + if (isset($_COOKIE['favorite_worker'])) { + $items = RusDate::count_item_fav(); + $it = $_COOKIE['favorite_worker']; + $it = str_replace('"', "", $it); + $it = str_replace('[', "", $it); + $it = str_replace(']', "", $it); + $Arr = explode(",", $it); + } else { + $Arr = Array(); + } $Workers = Worker::query(); $Workers = $Workers->whereIn('id', $Arr); @@ -382,7 +386,7 @@ class EmployerController extends Controller // Данные $users = $users->Baseuser()-> - orderBy(Worker::select('position_work')->whereColumn('workers.user_id', 'users.id'))-> + orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> paginate(5); return view('employers.bd', compact('users')); diff --git a/resources/views/layout/frontend.blade.php b/resources/views/layout/frontend.blade.php index fa4e9c2..172c298 100644 --- a/resources/views/layout/frontend.blade.php +++ b/resources/views/layout/frontend.blade.php @@ -224,224 +224,28 @@