|
@@ -44,6 +44,7 @@ class InquiryMonthlyCount extends Command |
|
@@ -44,6 +44,7 @@ class InquiryMonthlyCount extends Command |
|
44
|
//按月统计询盘记录
|
44
|
//按月统计询盘记录
|
|
45
|
$this->inquiryCount($startTime,$endTime,$value['test_domain'],$value['project_id']);
|
45
|
$this->inquiryCount($startTime,$endTime,$value['test_domain'],$value['project_id']);
|
|
46
|
}
|
46
|
}
|
|
|
|
47
|
+ return true;
|
|
47
|
}
|
48
|
}
|
|
48
|
|
49
|
|
|
49
|
/**
|
50
|
/**
|
|
@@ -82,6 +83,7 @@ class InquiryMonthlyCount extends Command |
|
@@ -82,6 +83,7 @@ class InquiryMonthlyCount extends Command |
|
82
|
$top20 = array_slice($countryArr, 0, 15, true);
|
83
|
$top20 = array_slice($countryArr, 0, 15, true);
|
|
83
|
$arr['country'] = json_encode($top20);
|
84
|
$arr['country'] = json_encode($top20);
|
|
84
|
$this->flowCount($arr,$startTime,$endTime,$project_id);
|
85
|
$this->flowCount($arr,$startTime,$endTime,$project_id);
|
|
|
|
86
|
+ $this->sourceCount($arr,$domain,$startTime,$endTime);
|
|
85
|
$arr['created_at'] = date('Y-m-d H:i:s');
|
87
|
$arr['created_at'] = date('Y-m-d H:i:s');
|
|
86
|
$arr['updated_at'] = date('Y-m-d H:i:s');
|
88
|
$arr['updated_at'] = date('Y-m-d H:i:s');
|
|
87
|
$arr['project_id'] = $project_id;
|
89
|
$arr['project_id'] = $project_id;
|
|
@@ -111,19 +113,26 @@ class InquiryMonthlyCount extends Command |
|
@@ -111,19 +113,26 @@ class InquiryMonthlyCount extends Command |
|
111
|
}
|
113
|
}
|
|
112
|
|
114
|
|
|
113
|
/**
|
115
|
/**
|
|
114
|
- * @remark :访问前8
|
116
|
+ * @remark :来源访问前8
|
|
115
|
* @name :sourceCount
|
117
|
* @name :sourceCount
|
|
116
|
* @author :lyh
|
118
|
* @author :lyh
|
|
117
|
* @method :post
|
119
|
* @method :post
|
|
118
|
* @time :2023/6/30 16:14
|
120
|
* @time :2023/6/30 16:14
|
|
119
|
*/
|
121
|
*/
|
|
120
|
- public function sourceCount(&$arr,$domain){
|
|
|
|
121
|
- $data = DB::table('gl_customer_visit')
|
122
|
+ public function sourceCount(&$arr,$domain,$startTime,$endTime){
|
|
|
|
123
|
+ $arr['source'] = DB::table('gl_customer_visit')
|
|
122
|
->select('referrer_url', DB::raw('COUNT(*) as count'))
|
124
|
->select('referrer_url', DB::raw('COUNT(*) as count'))
|
|
123
|
->groupBy('referrer_url')->where(['domain'=>$domain])
|
125
|
->groupBy('referrer_url')->where(['domain'=>$domain])
|
|
|
|
126
|
+ ->where('updated_date','>=',$startTime->toDateString())
|
|
|
|
127
|
+ ->where('updated_date','<=',$endTime->toDateString())
|
|
124
|
->orderByDesc('count')->limit(8)->get()->toArray();
|
128
|
->orderByDesc('count')->limit(8)->get()->toArray();
|
|
125
|
if(!empty($data)){
|
129
|
if(!empty($data)){
|
|
126
|
- $arr['source'] = json_encode($data);
|
130
|
+ $arr['source'] = json_encode($arr['source']);
|
|
127
|
}
|
131
|
}
|
|
|
|
132
|
+ $arr['source_country'] = DB::table('gl_customer_visit')
|
|
|
|
133
|
+ ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
|
|
|
|
134
|
+ ->groupBy('country')->where(['domain'=>$domain])
|
|
|
|
135
|
+ ->orderBy('ip','desc')->limit(15)->get()->toArray();
|
|
|
|
136
|
+ return $arr;
|
|
128
|
}
|
137
|
}
|
|
129
|
} |
138
|
} |