From fbfdd41a8ec5148dd201e6a57c7132b89815b85b Mon Sep 17 00:00:00 2001 From: Afila Date: Tue, 28 Jun 2022 15:30:45 +0700 Subject: [PATCH 1/3] perbaiki counter pengunjung --- app/Helpers/Counter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Helpers/Counter.php b/app/Helpers/Counter.php index 666f6a304..33ea4a1da 100755 --- a/app/Helpers/Counter.php +++ b/app/Helpers/Counter.php @@ -162,10 +162,10 @@ public function allVisitors($days = null) { $prefix = config('database.connections.' . config('database.default') . '.prefix'); if ($days) { - $hits = DB::table($prefix . 'das_counter_page_visitor')->groupBy('visitor_id')->where('created_at', '>=', Carbon::now()->subDays($days))->count(); - } else { - $hits = DB::table($prefix . 'das_counter_page_visitor')->groupBy('visitor_id')->count(); - } + $hits = DB::table($prefix . 'das_counter_page_visitor')->distinct('visitor_id')->where('created_at', '>=', Carbon::now()->subDays($days))->count(); + } else { + $hits = DB::table($prefix . 'das_counter_page_visitor')->distinct('visitor_id')->count(); + } return number_format($hits); } @@ -200,7 +200,7 @@ private function processHit($page) */ private static function hashVisitor() { - $cookie = Cookie::get(env('COUNTER_COOKIE', 'kryptonit3-counter')); + $cookie = Cookie::get(env('COUNTER_COOKIE', 'kd_session')); $visitor = $cookie !== false ? $cookie : $_SERVER['REMOTE_ADDR']; return hash("SHA256", env('APP_KEY') . $visitor); } From 3737027fc326b1cbeb932081ff503488bfe3e109 Mon Sep 17 00:00:00 2001 From: apidong Date: Tue, 28 Jun 2022 08:32:21 +0000 Subject: [PATCH 2/3] Fix styling --- app/Helpers/Counter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Helpers/Counter.php b/app/Helpers/Counter.php index 33ea4a1da..c21627593 100755 --- a/app/Helpers/Counter.php +++ b/app/Helpers/Counter.php @@ -163,9 +163,9 @@ public function allVisitors($days = null) $prefix = config('database.connections.' . config('database.default') . '.prefix'); if ($days) { $hits = DB::table($prefix . 'das_counter_page_visitor')->distinct('visitor_id')->where('created_at', '>=', Carbon::now()->subDays($days))->count(); - } else { + } else { $hits = DB::table($prefix . 'das_counter_page_visitor')->distinct('visitor_id')->count(); - } + } return number_format($hits); } From bd9e5fd276bb975d1f3d4642e6ebe0d4fb2b1c0c Mon Sep 17 00:00:00 2001 From: Agung Sugiarto Date: Thu, 30 Jun 2022 09:56:44 +0700 Subject: [PATCH 3/3] [ci skip] Mutakhirkan catatan rilis --- catatan_rilis.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catatan_rilis.md b/catatan_rilis.md index 73655e18f..37b9c7365 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -11,10 +11,11 @@ Terima kasih pada [untuk diisi] yang terus berkontribusi. Terima kasih pula pada #### Perbaikan BUG 1. [#430](https://github.com/OpenSID/OpenDK/issues/430) Perbaiki ihat daftar prosedur di menu unduhan error 500. +2. [#441](https://github.com/OpenSID/OpenDK/issues/441) Perbaiki perhitungan statistik pengunjung website. #### TEKNIS 1. [#427](https://github.com/OpenSID/OpenDK/pull/427) Teknis perbaiki error 500 setelah login. -2. [#431](https://github.com/OpenSID/OpenDK/pull/431) Teknis ignore .phpcs-cache +2. [#431](https://github.com/OpenSID/OpenDK/pull/431) Teknis ignore .phpcs-cache.