|
@@ -118,25 +118,24 @@ class MonthCountLogic extends BaseLogic |
|
@@ -118,25 +118,24 @@ class MonthCountLogic extends BaseLogic |
|
118
|
*/
|
118
|
*/
|
|
119
|
public function sourceCount(&$arr,$startTime,$endTime,$domain){
|
119
|
public function sourceCount(&$arr,$startTime,$endTime,$domain){
|
|
120
|
//访问来源前10
|
120
|
//访问来源前10
|
|
121
|
- $domain = 'http://lxl.petuu.shop/';
|
|
|
|
122
|
$source = DB::table('gl_customer_visit')
|
121
|
$source = DB::table('gl_customer_visit')
|
|
123
|
->select('referrer_url', DB::raw('COUNT(*) as count'))
|
122
|
->select('referrer_url', DB::raw('COUNT(*) as count'))
|
|
124
|
->groupBy('referrer_url')->where(['domain'=>$domain])
|
123
|
->groupBy('referrer_url')->where(['domain'=>$domain])
|
|
125
|
-// ->whereBetween('updated_date', [$startTime,$endTime])
|
124
|
+ ->whereBetween('updated_date', [$startTime,$endTime])
|
|
126
|
->orderByDesc('count')->limit(10)->get()->toArray();
|
125
|
->orderByDesc('count')->limit(10)->get()->toArray();
|
|
127
|
$arr['source'] = $source;
|
126
|
$arr['source'] = $source;
|
|
128
|
//访问国家前15
|
127
|
//访问国家前15
|
|
129
|
$source_country = DB::table('gl_customer_visit')
|
128
|
$source_country = DB::table('gl_customer_visit')
|
|
130
|
->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
|
129
|
->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
|
|
131
|
->groupBy('country')->where(['domain'=>$domain])
|
130
|
->groupBy('country')->where(['domain'=>$domain])
|
|
132
|
-// ->whereBetween('updated_date', [$startTime,$endTime])
|
131
|
+ ->whereBetween('updated_date', [$startTime,$endTime])
|
|
133
|
->orderBy('ip','desc')->limit(15)->get()->toArray();
|
132
|
->orderBy('ip','desc')->limit(15)->get()->toArray();
|
|
134
|
$arr['source_country'] = $source_country;
|
133
|
$arr['source_country'] = $source_country;
|
|
135
|
//受访界面前15
|
134
|
//受访界面前15
|
|
136
|
$referrer_url = DB::table('gl_customer_visit')
|
135
|
$referrer_url = DB::table('gl_customer_visit')
|
|
137
|
->select('url',DB::raw('COUNT(*) as num'))
|
136
|
->select('url',DB::raw('COUNT(*) as num'))
|
|
138
|
->orderBy('num','desc')->where(['domain'=>$domain])
|
137
|
->orderBy('num','desc')->where(['domain'=>$domain])
|
|
139
|
-// ->whereBetween('updated_date', [$startTime,$endTime])
|
138
|
+ ->whereBetween('updated_date', [$startTime,$endTime])
|
|
140
|
->groupBy('url')
|
139
|
->groupBy('url')
|
|
141
|
->limit(15)->get()->toArray();
|
140
|
->limit(15)->get()->toArray();
|
|
142
|
$arr['referrer_url'] = $referrer_url;
|
141
|
$arr['referrer_url'] = $referrer_url;
|
|
@@ -144,7 +143,7 @@ class MonthCountLogic extends BaseLogic |
|
@@ -144,7 +143,7 @@ class MonthCountLogic extends BaseLogic |
|
144
|
$referrer_port = DB::table('gl_customer_visit')
|
143
|
$referrer_port = DB::table('gl_customer_visit')
|
|
145
|
->select('device_port',DB::raw('COUNT(*) as num'))
|
144
|
->select('device_port',DB::raw('COUNT(*) as num'))
|
|
146
|
->orderBy('num','desc')->where(['domain'=>$domain])
|
145
|
->orderBy('num','desc')->where(['domain'=>$domain])
|
|
147
|
-// ->whereBetween('updated_date', [$startTime,$endTime])
|
146
|
+ ->whereBetween('updated_date', [$startTime,$endTime])
|
|
148
|
->groupBy('device_port')
|
147
|
->groupBy('device_port')
|
|
149
|
->limit(15)->get()->toArray();
|
148
|
->limit(15)->get()->toArray();
|
|
150
|
$arr['referrer_port'] = $referrer_port;
|
149
|
$arr['referrer_port'] = $referrer_port;
|