作者 lyh

gx

@@ -35,7 +35,7 @@ class CountController extends BaseController @@ -35,7 +35,7 @@ class CountController extends BaseController
35 //TODO::30天pv,ip统计 35 //TODO::30天pv,ip统计
36 $data['visit_data'] = $countLogic->visit_data_count(); 36 $data['visit_data'] = $countLogic->visit_data_count();
37 //TODO::询盘国家统计 37 //TODO::询盘国家统计
38 - $data['country_data'] = $countLogic->inquiry_country_count(); 38 + $data['country_data'] = json_decode($data['yesterday']['country']);
39 //TODO::来源排名 39 //TODO::来源排名
40 $data['referrer_count'] = $countLogic->referrer_count(); 40 $data['referrer_count'] = $countLogic->referrer_count();
41 //TODO::访问国家前10 41 //TODO::访问国家前10
@@ -30,7 +30,7 @@ class CountLogic extends BaseLogic @@ -30,7 +30,7 @@ class CountLogic extends BaseLogic
30 'date' => $yesterday, 30 'date' => $yesterday,
31 'project_id' => $this->user['project_id'] 31 'project_id' => $this->user['project_id']
32 ]; 32 ];
33 - $info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day']); 33 + $info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);
34 if($info === false){ 34 if($info === false){
35 $info = []; 35 $info = [];
36 } 36 }
@@ -122,23 +122,6 @@ class CountLogic extends BaseLogic @@ -122,23 +122,6 @@ class CountLogic extends BaseLogic
122 return $this->success($data); 122 return $this->success($data);
123 } 123 }
124 124
125 - /**  
126 - * @name :(询盘国家统计)inquiry_country_count  
127 - * @author :lyh  
128 - * @method :post  
129 - * @time :2023/5/24 14:58  
130 - */  
131 - public function inquiry_country_count(){  
132 - $data = DB::table('gl_xunpan_ipdata')  
133 - ->select('ip_area', DB::raw('COUNT(ip_area) as count'))  
134 - ->groupBy('ip_area')->orderBy('count','desc')->limit(10)->get()->toArray();  
135 - $data = object_to_array($data);  
136 - $total = DB::table('gl_xunpan_ipdata')->count();  
137 - foreach ($data as $k=>$v){  
138 - $data[$k]['proportion'] = ($v['count']/$total) * 100;  
139 - }  
140 - return $this->success($data);  
141 - }  
142 125
143 /** 126 /**
144 * @name :(访问来源统计)referrer_count 127 * @name :(访问来源统计)referrer_count