作者 lyh

gx

@@ -139,11 +139,10 @@ class CountLogic extends BaseLogic @@ -139,11 +139,10 @@ class CountLogic extends BaseLogic
139 $data = $customerVisitModel->select('referrer_url', DB::raw('COUNT(*) as count')) 139 $data = $customerVisitModel->select('referrer_url', DB::raw('COUNT(*) as count'))
140 ->groupBy('referrer_url')->where(['domain'=>$this->user['domain']]) 140 ->groupBy('referrer_url')->where(['domain'=>$this->user['domain']])
141 ->orderByDesc('count')->limit(8)->get()->toArray(); 141 ->orderByDesc('count')->limit(8)->get()->toArray();
142 - var_dump($data);  
143 - die();  
144 $total = $customerVisitModel->count(); 142 $total = $customerVisitModel->count();
145 if(!empty($data)){ 143 if(!empty($data)){
146 - $data = object_to_array($data); 144 + var_dump($data);
  145 + die();
147 foreach ($data as $k=>$v){ 146 foreach ($data as $k=>$v){
148 $data[$k]['proportion'] = ($v['count']/$total) * 100; 147 $data[$k]['proportion'] = ($v['count']/$total) * 100;
149 } 148 }
@@ -163,7 +162,6 @@ class CountLogic extends BaseLogic @@ -163,7 +162,6 @@ class CountLogic extends BaseLogic
163 ->groupBy('country')->where(['domain'=>$this->user['domain']]) 162 ->groupBy('country')->where(['domain'=>$this->user['domain']])
164 ->orderBy('ip','desc')->limit(10)->get()->toArray(); 163 ->orderBy('ip','desc')->limit(10)->get()->toArray();
165 if(!empty($data)){ 164 if(!empty($data)){
166 - $data = object_to_array($data);  
167 foreach ($data as $k => $v){ 165 foreach ($data as $k => $v){
168 $v['pv'] = (int)$v['pv']; 166 $v['pv'] = (int)$v['pv'];
169 $data[$k] = $v; 167 $data[$k] = $v;