From f0b6d25e98632aa5b60c0ddb0e55effc81d4319f 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: Fri, 22 Sep 2023 21:11:27 +0700 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B3=20=D1=81=20id=20=D1=8E=D0=B7=D0?= =?UTF-8?q?=B5=D1=80=D0=BE=D0=B2=20=D0=B2=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B5=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BE=D0=B4=D0=B0=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=B8=20redis=20=D0=BA=D0=BE=D0=BD=D0=BD=D0=B5=D0=BA=D1?= =?UTF-8?q?=82=D0=BE=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/EmployersController.php | 2 +- app/Http/Controllers/PagesController.php | 13 +++++++++++++ resources/views/admin/employer/index.blade.php | 6 +++--- resources/views/admin/employer/index_ajax.blade.php | 10 +++++----- routes/web.php | 2 ++ 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Admin/EmployersController.php b/app/Http/Controllers/Admin/EmployersController.php index b75c168..dfbe303 100644 --- a/app/Http/Controllers/Admin/EmployersController.php +++ b/app/Http/Controllers/Admin/EmployersController.php @@ -33,7 +33,7 @@ class EmployersController extends Controller }); }*/ - $users = User::select(['users.*', 'emp.id as emp_id', 'emp.*'])->join('employers as emp','emp.user_id','users.id') + $users = User::select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.*'])->join('employers as emp','emp.user_id','users.id') ->where('users.is_worker', '0'); $find_key = ""; if (isset($request->find)) { diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index d771353..fab727e 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\pages; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Redis; class PagesController extends Controller { @@ -11,4 +12,16 @@ class PagesController extends Controller $page = pages::query()->where('slug', $pages->slug)->first(); print_r($page); } + + public function redis() { + $redis = Redis::connection(); + $redis->set('User:CompanyName', 'РЕКАМОРЕ'); + $id = 1; + //dd(Redis::get('MyVar')); + $redis->command('rpush', array("Сообщение1")); + $redis->command('rpush', array("Сообщение2")); + $values = $redis->command('lrange', array("mylist", 0, 1)); + dd($values); + + } } diff --git a/resources/views/admin/employer/index.blade.php b/resources/views/admin/employer/index.blade.php index 7ca0b58..47e679d 100644 --- a/resources/views/admin/employer/index.blade.php +++ b/resources/views/admin/employer/index.blade.php @@ -86,7 +86,7 @@ - {{ $user->name_man }} ({{ $user->emp_id }}) + {{ $user->name_man }} ({{ $user->usr_id }}) {{ $user->created_at }} @@ -97,8 +97,8 @@ @endif - @if ($user->id > 1) - is_ban) ? "checked" : "" }}/> + @if ($user->usr_id > 1) + is_ban) ? "checked" : "" }}/> @endif diff --git a/resources/views/admin/employer/index_ajax.blade.php b/resources/views/admin/employer/index_ajax.blade.php index 4b39960..ed6048f 100644 --- a/resources/views/admin/employer/index_ajax.blade.php +++ b/resources/views/admin/employer/index_ajax.blade.php @@ -40,19 +40,19 @@ - {{ $user->name_man }} + {{ $user->name_man }} ({{ $user->usr_id }}) {{ $user->created_at }} - @if ($user->id > 1) - Изменить + @if (!empty($user->emp_id)) + Изменить @endif - @if ($user->id > 1) - is_ban) ? "checked" : "" }}/> + @if ($user->usr_id > 1) + is_ban) ? "checked" : "" }}/> @endif diff --git a/routes/web.php b/routes/web.php index ea807db..25f34b2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -273,3 +273,5 @@ Route::group([ Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); + +Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); -- 1.7.10.4