作者 lyh

gx

@@ -163,11 +163,16 @@ class CountLogic extends BaseLogic @@ -163,11 +163,16 @@ class CountLogic extends BaseLogic
163 $customerVisitModel = new Visit(); 163 $customerVisitModel = new Visit();
164 $data = $customerVisitModel->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) 164 $data = $customerVisitModel->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
165 ->groupBy('country') 165 ->groupBy('country')
166 - ->orderBy('ip','desc')->limit(10)->get()->toArray(); 166 + ->orderBy('ip','desc')->limit(11)->get()->toArray();
167 if(!empty($data)){ 167 if(!empty($data)){
  168 + $result =array();
168 foreach ($data as $k => $v){ 169 foreach ($data as $k => $v){
  170 + if(($this->project['is_record_china_visit'] == 1) && ($v['country'] == '中国')){
  171 + continue;
  172 + }else{
169 $v['pv'] = (int)$v['pv']; 173 $v['pv'] = (int)$v['pv'];
170 - $data[$k] = $v; 174 + $result[] = $v;
  175 + }
171 } 176 }
172 } 177 }
173 return $this->success($data); 178 return $this->success($data);