|
...
|
...
|
@@ -204,9 +204,9 @@ class OptimizationReportController extends BaseController |
|
|
|
$query = DB::connection('custom_mysql')->table('gl_customer_visit')
|
|
|
|
->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
|
|
|
|
->groupBy('country');
|
|
|
|
if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
|
|
|
|
|
|
|
|
$query->where('country','<>','中国');
|
|
|
|
}
|
|
|
|
|
|
|
|
$source_country = $query->whereBetween('updated_date', [$startTime,$endTime])
|
|
|
|
->orderBy('ip','desc')->limit(15)->get()->toArray();
|
|
|
|
$arr['source_country'] = $source_country;
|
|
...
|
...
|
@@ -366,12 +366,8 @@ class OptimizationReportController extends BaseController |
|
|
|
$result =array();
|
|
|
|
if(!empty($data)){
|
|
|
|
foreach ($data as $k => $v){
|
|
|
|
if(($this->project['is_record_china_visit'] != 1) && ($v['country'] == '中国')){
|
|
|
|
continue;
|
|
|
|
}else{
|
|
|
|
$v['pv'] = (int)$v['pv'];
|
|
|
|
$result[] = $v;
|
|
|
|
}
|
|
|
|
$v['pv'] = (int)$v['pv'];
|
|
|
|
$result[] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $result;
|
...
|
...
|
|