作者 lyh

gx

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