作者 lyh

gx

@@ -155,19 +155,14 @@ class MonthCountLogic extends BaseLogic @@ -155,19 +155,14 @@ class MonthCountLogic extends BaseLogic
155 ->orderByDesc('count')->limit(10)->get()->toArray(); 155 ->orderByDesc('count')->limit(10)->get()->toArray();
156 $arr['source'] = $source; 156 $arr['source'] = $source;
157 //访问国家前15 157 //访问国家前15
158 - $source_country = DB::connection('custom_mysql')->table('gl_customer_visit') 158 + $query = DB::connection('custom_mysql')->table('gl_customer_visit')
159 ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) 159 ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
160 - ->groupBy('country')  
161 - ->whereBetween('updated_date', [$startTime,$endTime])  
162 - ->orderBy('ip','desc')->limit(15)->get()->toArray(); 160 + ->groupBy('country');
163 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){ 161 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
164 - foreach ($source_country as $k => $v){  
165 - $v = (array)$v;  
166 - if($v['country'] == '中国'){  
167 - unset($source_country[$k]);  
168 - }  
169 - } 162 + $query->where('country','<>','中国');
170 } 163 }
  164 + $source_country = $query->whereBetween('updated_date', [$startTime,$endTime])
  165 + ->orderBy('ip','desc')->limit(15)->get()->toArray();
171 $arr['source_country'] = $source_country; 166 $arr['source_country'] = $source_country;
172 //受访界面前15 167 //受访界面前15
173 $referrer_url = DB::connection('custom_mysql')->table('gl_customer_visit') 168 $referrer_url = DB::connection('custom_mysql')->table('gl_customer_visit')