From 1daa8d43ea98e3e5c617d49b02cb435b3fea6ec9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 10 Sep 2018 21:06:36 -0600 Subject: [PATCH] Update AdminController, remove stats for now --- app/Http/Controllers/AdminController.php | 6 +++--- resources/views/admin/users/home.blade.php | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index ad667602b..97cc1ff5e 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -29,7 +29,7 @@ class AdminController extends Controller public function users(Request $request) { - $stats = $this->collectUserStats($request); + $stats = []; $users = User::orderBy('id', 'desc')->paginate(10); return view('admin.users.home', compact('users', 'stats')); } @@ -77,7 +77,7 @@ class AdminController extends Controller protected function collectUserStats($request) - { + { $total_duration = $request->query('total_duration') ?? '30'; $new_duration = $request->query('new_duration') ?? '7'; $stats = []; @@ -97,7 +97,7 @@ class AdminController extends Controller 'remote' => Profile::whereNotNull('remote_url')->count() ]; $stats['avg'] = [ - 'age' => Carbon::parse(substr(User::avg('created_at'),0,8))->diffForHumans(null,true,true), + 'age' => 0, 'posts' => floor(Status::avg('profile_id')) ]; return $stats; diff --git a/resources/views/admin/users/home.blade.php b/resources/views/admin/users/home.blade.php index 7eb47f5ef..44ab69976 100644 --- a/resources/views/admin/users/home.blade.php +++ b/resources/views/admin/users/home.blade.php @@ -4,7 +4,8 @@

Users

-
+
+ {{--
@@ -17,7 +18,7 @@ - --}} +

{{$stats['total']['count']}}

@@ -38,7 +39,7 @@ - --}} +

{{$stats['new']['count']}}

@@ -95,7 +96,7 @@
-
+
--}}
@@ -215,8 +216,8 @@ lineColor: '#0083CD', fillColor: false }; - $('.totalUsers').sparkline({{$stats['total']['points']}}, sparkopts); - $('.newUsers').sparkline({{$stats['new']['points']}}, sparkopts); + {{-- $('.totalUsers').sparkline({{$stats['total']['points']}}, sparkopts); + $('.newUsers').sparkline({{$stats['new']['points']}}, sparkopts); --}} }); @endpush