正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -161,8 +161,8 @@ class CountLogic extends BaseLogic | @@ -161,8 +161,8 @@ class CountLogic extends BaseLogic | ||
| 161 | */ | 161 | */ |
| 162 | public function access_country_count(){ | 162 | public function access_country_count(){ |
| 163 | $customerVisitModel = new Visit(); | 163 | $customerVisitModel = new Visit(); |
| 164 | - $data = $customerVisitModel->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) | ||
| 165 | - ->groupBy('country')->where(['domain'=>$this->user['domain']]) | 164 | + $data = $customerVisitModel->select('country',DB::raw('COUNT(DISTINCT ip) as ip_count'),DB::raw('SUM(depth) as pv')) |
| 165 | + ->groupBy('country') | ||
| 166 | ->orderBy('ip','desc')->limit(10)->get()->toArray(); | 166 | ->orderBy('ip','desc')->limit(10)->get()->toArray(); |
| 167 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND); | 167 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND); |
| 168 | if(!empty($data)){ | 168 | if(!empty($data)){ |
-
请 注册 或 登录 后发表评论