|
...
|
...
|
@@ -120,19 +120,24 @@ class InquiryMonthlyCount extends Command |
|
|
|
* @time :2023/6/30 16:14
|
|
|
|
*/
|
|
|
|
public function sourceCount(&$arr,$domain,$startTime,$endTime){
|
|
|
|
//访问来源前10
|
|
|
|
$arr['source'] = DB::table('gl_customer_visit')
|
|
|
|
->select('referrer_url', DB::raw('COUNT(*) as count'))
|
|
|
|
->groupBy('referrer_url')->where(['domain'=>$domain])
|
|
|
|
->where('updated_date','>=',$startTime->toDateString())
|
|
|
|
->where('updated_date','<=',$endTime->toDateString())
|
|
|
|
->orderByDesc('count')->limit(8)->get()->toArray();
|
|
|
|
->orderByDesc('count')->limit(10)->get()->toArray();
|
|
|
|
if(!empty($data)){
|
|
|
|
$arr['source'] = json_encode($arr['source']);
|
|
|
|
}
|
|
|
|
//访问国家前15
|
|
|
|
$arr['source_country'] = DB::table('gl_customer_visit')
|
|
|
|
->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
|
|
|
|
->groupBy('country')->where(['domain'=>$domain])
|
|
|
|
->where('updated_date','>=',$startTime->toDateString())
|
|
|
|
->where('updated_date','<=',$endTime->toDateString())
|
|
|
|
->orderBy('ip','desc')->limit(15)->get()->toArray();
|
|
|
|
//受访界面
|
|
|
|
return $arr;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|