作者 lyh

gx

@@ -137,7 +137,22 @@ class InquiryMonthlyCount extends Command @@ -137,7 +137,22 @@ class InquiryMonthlyCount extends Command
137 ->where('updated_date','>=',$startTime->toDateString()) 137 ->where('updated_date','>=',$startTime->toDateString())
138 ->where('updated_date','<=',$endTime->toDateString()) 138 ->where('updated_date','<=',$endTime->toDateString())
139 ->orderBy('ip','desc')->limit(15)->get()->toArray(); 139 ->orderBy('ip','desc')->limit(15)->get()->toArray();
140 - //受访界面 140 + //受访界面前15
  141 + $arr['referrer_url'] = DB::table('gl_customer_visit_item')
  142 + ->select('url',DB::raw('COUNT(*) as num'))
  143 + ->orderBy('num','desc')
  144 + ->where('updated_date','>=',$startTime->toDateString())
  145 + ->where('updated_date','<=',$endTime->toDateString())
  146 + ->groupBy('url')->where(['domain'=>'http://lxl.petuu.shop/'])
  147 + ->limit(15)->get()->toArray();
  148 + //访问断后
  149 + $arr['referrer_url'] = DB::table('gl_customer_visit_item')
  150 + ->select('device_port',DB::raw('COUNT(*) as num'))
  151 + ->orderBy('num','desc')
  152 + ->where('updated_date','>=',$startTime->toDateString())
  153 + ->where('updated_date','<=',$endTime->toDateString())
  154 + ->groupBy('url')->where(['domain'=>'http://lxl.petuu.shop/'])
  155 + ->limit(15)->get()->toArray();
141 return $arr; 156 return $arr;
142 } 157 }
143 } 158 }
@@ -151,12 +151,11 @@ class ComController extends BaseController @@ -151,12 +151,11 @@ class ComController extends BaseController
151 $startTime = Carbon::now()->subMonth()->startOfMonth()->toDateString(); 151 $startTime = Carbon::now()->subMonth()->startOfMonth()->toDateString();
152 // 获取上个月的结束时间 152 // 获取上个月的结束时间
153 $endTime = Carbon::now()->subMonth()->endOfMonth()->toDateString(); 153 $endTime = Carbon::now()->subMonth()->endOfMonth()->toDateString();
154 - $arr = DB::table('gl_customer_visit_item')  
155 - ->select('url',DB::raw('COUNT(*) as num')) 154 + $arr['referrer_url'] = DB::table('gl_customer_visit_item')
  155 + ->select('device_port',DB::raw('COUNT(*) as num'))
156 ->orderBy('num','desc') 156 ->orderBy('num','desc')
157 ->groupBy('url')->where(['domain'=>'http://lxl.petuu.shop/']) 157 ->groupBy('url')->where(['domain'=>'http://lxl.petuu.shop/'])
158 ->limit(15)->get()->toArray(); 158 ->limit(15)->get()->toArray();
159 -  
160 return $arr; 159 return $arr;
161 } 160 }
162 161