|
@@ -125,24 +125,21 @@ class InquiryMonthlyCount extends Command |
|
@@ -125,24 +125,21 @@ class InquiryMonthlyCount extends Command |
|
125
|
$source = DB::table('gl_customer_visit')
|
125
|
$source = DB::table('gl_customer_visit')
|
|
126
|
->select('referrer_url', DB::raw('COUNT(*) as count'))
|
126
|
->select('referrer_url', DB::raw('COUNT(*) as count'))
|
|
127
|
->groupBy('referrer_url')->where(['domain'=>$domain])
|
127
|
->groupBy('referrer_url')->where(['domain'=>$domain])
|
|
128
|
- ->where('updated_date','>=',$startTime->toDateString())
|
|
|
|
129
|
- ->where('updated_date','<=',$endTime->toDateString())
|
128
|
+ ->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()])
|
|
130
|
->orderByDesc('count')->limit(10)->get()->toArray();
|
129
|
->orderByDesc('count')->limit(10)->get()->toArray();
|
|
131
|
$arr['source'] = json_encode($source);
|
130
|
$arr['source'] = json_encode($source);
|
|
132
|
//访问国家前15
|
131
|
//访问国家前15
|
|
133
|
$source_country = DB::table('gl_customer_visit')
|
132
|
$source_country = DB::table('gl_customer_visit')
|
|
134
|
->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
|
133
|
->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
|
|
135
|
->groupBy('country')->where(['domain'=>$domain])
|
134
|
->groupBy('country')->where(['domain'=>$domain])
|
|
136
|
- ->where('updated_date','>=',$startTime->toDateString())
|
|
|
|
137
|
- ->where('updated_date','<=',$endTime->toDateString())
|
135
|
+ ->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()])
|
|
138
|
->orderBy('ip','desc')->limit(15)->get()->toArray();
|
136
|
->orderBy('ip','desc')->limit(15)->get()->toArray();
|
|
139
|
$arr['source_country'] = json_encode($source_country);
|
137
|
$arr['source_country'] = json_encode($source_country);
|
|
140
|
//受访界面前15
|
138
|
//受访界面前15
|
|
141
|
$referrer_url = DB::table('gl_customer_visit')
|
139
|
$referrer_url = DB::table('gl_customer_visit')
|
|
142
|
->select('url',DB::raw('COUNT(*) as num'))
|
140
|
->select('url',DB::raw('COUNT(*) as num'))
|
|
143
|
->orderBy('num','desc')->where(['domain'=>$domain])
|
141
|
->orderBy('num','desc')->where(['domain'=>$domain])
|
|
144
|
- ->where('updated_date','>=',$startTime->toDateString())
|
|
|
|
145
|
- ->where('updated_date','<=',$endTime->toDateString())
|
142
|
+ ->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()])
|
|
146
|
->groupBy('url')
|
143
|
->groupBy('url')
|
|
147
|
->limit(15)->get()->toArray();
|
144
|
->limit(15)->get()->toArray();
|
|
148
|
$arr['referrer_url'] = json_encode($referrer_url);
|
145
|
$arr['referrer_url'] = json_encode($referrer_url);
|
|
@@ -150,8 +147,7 @@ class InquiryMonthlyCount extends Command |
|
@@ -150,8 +147,7 @@ class InquiryMonthlyCount extends Command |
|
150
|
$referrer_port = DB::table('gl_customer_visit')
|
147
|
$referrer_port = DB::table('gl_customer_visit')
|
|
151
|
->select('device_port',DB::raw('COUNT(*) as num'))
|
148
|
->select('device_port',DB::raw('COUNT(*) as num'))
|
|
152
|
->orderBy('num','desc')->where(['domain'=>$domain])
|
149
|
->orderBy('num','desc')->where(['domain'=>$domain])
|
|
153
|
- ->where('updated_date','>=',$startTime->toDateString())
|
|
|
|
154
|
- ->where('updated_date','<=',$endTime->toDateString())
|
150
|
+ ->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()])
|
|
155
|
->groupBy('device_port')
|
151
|
->groupBy('device_port')
|
|
156
|
->limit(15)->get()->toArray();
|
152
|
->limit(15)->get()->toArray();
|
|
157
|
$arr['referrer_port'] = json_encode($referrer_port);
|
153
|
$arr['referrer_port'] = json_encode($referrer_port);
|