From 7cc911efc4b7faf4b8bff4a3eeff6b2e5b262bd0 Mon Sep 17 00:00:00 2001 From: Tao Date: Mon, 13 Jan 2020 17:39:46 -0800 Subject: [PATCH] ip block --- src/Http/Controllers/dashboardController.php | 36 ++++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Http/Controllers/dashboardController.php b/src/Http/Controllers/dashboardController.php index 9679a53..44ddba8 100644 --- a/src/Http/Controllers/dashboardController.php +++ b/src/Http/Controllers/dashboardController.php @@ -72,24 +72,24 @@ public function dashboard(Request $request) $ip = $_SERVER['REMOTE_ADDR'];//'98.176.248.193';// //$ip = file_get_contents('https://api.ipify.org'); //$query = json_decode(file_get_contents('http://ip-api.com/json/'.$ip)); - $query = json_decode(file_get_contents("https://ipinfo.io/$ip/json")); - if(!isset($query->bogon) && !isset($query->error)) { - $country = $query->country; - $region = $query->region; - $city = $query->city; - $add = DB::table('ip_info')->insert([ - 'user_name' => $userName, - 'ip' => $ip, - 'country' => $country, - 'region' => $region, - 'city' => $city - ]); - - if ($add) { - $period = date('Y-M'); - DB::table('ip_info_rate')->where('period', $period)->increment('rate', 1); - } - } +// $query = json_decode(file_get_contents("https://ipinfo.io/$ip/json")); +// if(!isset($query->bogon) && !isset($query->error)) { +// $country = $query->country; +// $region = $query->region; +// $city = $query->city; +// $add = DB::table('ip_info')->insert([ +// 'user_name' => $userName, +// 'ip' => $ip, +// 'country' => $country, +// 'region' => $region, +// 'city' => $city +// ]); +// +// if ($add) { +// $period = date('Y-M'); +// DB::table('ip_info_rate')->where('period', $period)->increment('rate', 1); +// } +// } ###################################################################### if (session('previousUrl'))