From eae6b80f5e37e6189f28730d708fd22e457ae9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Thu, 19 Oct 2023 13:02:39 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=BE=D0=B4=D0=B0=D1?= =?UTF-8?q?=82=D0=B5=D0=BB=D1=8C=20=D0=BB=D0=BE=D0=B3=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/EmployersController.php | 3 ++- resources/views/admin/employer/edit.blade.php | 6 +++--- resources/views/admin/employer/index.blade.php | 9 +++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Admin/EmployersController.php b/app/Http/Controllers/Admin/EmployersController.php index 103414d..f982df8 100644 --- a/app/Http/Controllers/Admin/EmployersController.php +++ b/app/Http/Controllers/Admin/EmployersController.php @@ -25,7 +25,8 @@ class EmployersController extends Controller $user->update($request->all()); } - $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.*'])->join('employers as emp','emp.user_id','users.id') + $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.logo as emp_logo', 'emp.*']) + ->join('employers as emp','emp.user_id','users.id') ->where('users.is_worker', '0')->Realuser(); $all_employer = $users->count(); diff --git a/resources/views/admin/employer/edit.blade.php b/resources/views/admin/employer/edit.blade.php index 3bb743c..ba50eab 100644 --- a/resources/views/admin/employer/edit.blade.php +++ b/resources/views/admin/employer/edit.blade.php @@ -92,9 +92,9 @@ @endisset @error('logo') - - {{ $message }} - + + {{ $message }} + @enderror
diff --git a/resources/views/admin/employer/index.blade.php b/resources/views/admin/employer/index.blade.php index 2fb5a36..b8fc7c7 100644 --- a/resources/views/admin/employer/index.blade.php +++ b/resources/views/admin/employer/index.blade.php @@ -41,7 +41,7 @@ btns.forEach(btn => { btn.addEventListener('click', (e) => { console.log('click button'); - const id = e.target.id; + let id = e.target.id; let form = document.getElementById("form_modal_del"); form.action = "/delete/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); //document.getElementById("title_modal").innerHTML = id; @@ -112,8 +112,9 @@ {{$user->name}} - @if (isset($user->employers[0]->logo) && ($user->employers[0]->logo)) - + + @if (isset($user->emp_logo) && ($user->emp_logo)) + @else - @endif @@ -141,7 +142,7 @@ @if (!empty($user->comment_admin)) - Есть + Есть @else Нет @endif -- 1.7.10.4