作者 lyh

gx

... ... @@ -125,24 +125,21 @@ class InquiryMonthlyCount extends Command
$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())
->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()])
->orderByDesc('count')->limit(10)->get()->toArray();
$arr['source'] = json_encode($source);
//访问国家前15
$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())
->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()])
->orderBy('ip','desc')->limit(15)->get()->toArray();
$arr['source_country'] = json_encode($source_country);
//受访界面前15
$referrer_url = DB::table('gl_customer_visit')
->select('url',DB::raw('COUNT(*) as num'))
->orderBy('num','desc')->where(['domain'=>$domain])
->where('updated_date','>=',$startTime->toDateString())
->where('updated_date','<=',$endTime->toDateString())
->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()])
->groupBy('url')
->limit(15)->get()->toArray();
$arr['referrer_url'] = json_encode($referrer_url);
... ... @@ -150,8 +147,7 @@ class InquiryMonthlyCount extends Command
$referrer_port = DB::table('gl_customer_visit')
->select('device_port',DB::raw('COUNT(*) as num'))
->orderBy('num','desc')->where(['domain'=>$domain])
->where('updated_date','>=',$startTime->toDateString())
->where('updated_date','<=',$endTime->toDateString())
->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()])
->groupBy('device_port')
->limit(15)->get()->toArray();
$arr['referrer_port'] = json_encode($referrer_port);
... ...
... ... @@ -123,24 +123,21 @@ class MonthCountLogic extends BaseLogic
$source = DB::table('gl_customer_visit')
->select('referrer_url', DB::raw('COUNT(*) as count'))
->groupBy('referrer_url')->where(['domain'=>$domain])
// ->where('updated_date','>=',$startTime)
// ->where('updated_date','<=',$endTime)
// ->whereBetween('updated_date', [$startTime,$endTime])
->orderByDesc('count')->limit(10)->get()->toArray();
$arr['source'] = $source;
//访问国家前15
$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)
// ->where('updated_date','<=',$endTime)
// ->whereBetween('updated_date', [$startTime,$endTime])
->orderBy('ip','desc')->limit(15)->get()->toArray();
$arr['source_country'] = $source_country;
//受访界面前15
$referrer_url = DB::table('gl_customer_visit')
->select('url',DB::raw('COUNT(*) as num'))
->orderBy('num','desc')->where(['domain'=>$domain])
// ->where('updated_date','>=',$startTime)
// ->where('updated_date','<=',$endTime)
// ->whereBetween('updated_date', [$startTime,$endTime])
->groupBy('url')
->limit(15)->get()->toArray();
$arr['referrer_url'] = $referrer_url;
... ... @@ -148,8 +145,7 @@ class MonthCountLogic extends BaseLogic
$referrer_port = DB::table('gl_customer_visit')
->select('device_port',DB::raw('COUNT(*) as num'))
->orderBy('num','desc')->where(['domain'=>$domain])
// ->where('updated_date','>=',$startTime)
// ->where('updated_date','<=',$endTime)
// ->whereBetween('updated_date', [$startTime,$endTime])
->groupBy('device_port')
->limit(15)->get()->toArray();
$arr['referrer_port'] = $referrer_port;
... ...