Skip to content

Commit

Permalink
perbaikan status pengunjung tidak bertambah (#443)
Browse files Browse the repository at this point in the history
* perbaiki counter pengunjung

* Fix styling

* [ci skip] Mutakhirkan catatan rilis

Co-authored-by: apidong <[email protected]>
Co-authored-by: Agung Sugiarto <[email protected]>
  • Loading branch information
3 people authored Jun 30, 2022
1 parent f89a535 commit cde2904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/Helpers/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion catatan_rilis.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit cde2904

Please sign in to comment.