diff --git a/app/Helpers/Counter.php b/app/Helpers/Counter.php index 666f6a304..c21627593 100755 --- a/app/Helpers/Counter.php +++ b/app/Helpers/Counter.php @@ -162,9 +162,9 @@ 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(); + $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')->groupBy('visitor_id')->count(); + $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); } 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.