|
@@ -34,13 +34,19 @@ class InquiryMonthlyCount extends Command |
|
@@ -34,13 +34,19 @@ class InquiryMonthlyCount extends Command |
|
34
|
* @time :2023/6/30 9:32
|
34
|
* @time :2023/6/30 9:32
|
|
35
|
*/
|
35
|
*/
|
|
36
|
public function handle(){
|
36
|
public function handle(){
|
|
37
|
- $deployModel = new DeployBuild();
|
|
|
|
38
|
- $list = $deployModel->list();
|
37
|
+ $list = DB::table('gl_project')
|
|
|
|
38
|
+ ->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id')
|
|
|
|
39
|
+ ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')
|
|
|
|
40
|
+ ->select($this->selectParam())->get()->toArray();
|
|
39
|
// 获取上个月的开始时间
|
41
|
// 获取上个月的开始时间
|
|
40
|
$startTime = Carbon::now()->subMonth()->startOfMonth();
|
42
|
$startTime = Carbon::now()->subMonth()->startOfMonth();
|
|
41
|
// 获取上个月的结束时间
|
43
|
// 获取上个月的结束时间
|
|
42
|
$endTime = Carbon::now()->subMonth()->endOfMonth();
|
44
|
$endTime = Carbon::now()->subMonth()->endOfMonth();
|
|
43
|
foreach ($list as $value){
|
45
|
foreach ($list as $value){
|
|
|
|
46
|
+ $value = (array)$value;
|
|
|
|
47
|
+ if($value['domain'] != ''){
|
|
|
|
48
|
+ $value['test_domain'] = $value['domain'];
|
|
|
|
49
|
+ }
|
|
44
|
$arr = [];
|
50
|
$arr = [];
|
|
45
|
//按月统计询盘记录
|
51
|
//按月统计询盘记录
|
|
46
|
$arr = $this->inquiryCount($arr,$startTime,$endTime,$value['test_domain']);
|
52
|
$arr = $this->inquiryCount($arr,$startTime,$endTime,$value['test_domain']);
|
|
@@ -66,8 +72,6 @@ class InquiryMonthlyCount extends Command |
|
@@ -66,8 +72,6 @@ class InquiryMonthlyCount extends Command |
|
66
|
* @time :2023/6/30 14:29
|
72
|
* @time :2023/6/30 14:29
|
|
67
|
*/
|
73
|
*/
|
|
68
|
public function inquiryCount(&$arr,&$startTime,&$endTime,$domain){
|
74
|
public function inquiryCount(&$arr,&$startTime,&$endTime,$domain){
|
|
69
|
- //TODO::上线后注释
|
|
|
|
70
|
-// $domain = 'https://demomark.globalso.com/';
|
|
|
|
71
|
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
|
75
|
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
|
|
72
|
//总数
|
76
|
//总数
|
|
73
|
$arr['total'] = $inquiry_list['data']['total'];
|
77
|
$arr['total'] = $inquiry_list['data']['total'];
|
|
@@ -153,4 +157,22 @@ class InquiryMonthlyCount extends Command |
|
@@ -153,4 +157,22 @@ class InquiryMonthlyCount extends Command |
|
153
|
$arr['referrer_port'] = json_encode($referrer_port);
|
157
|
$arr['referrer_port'] = json_encode($referrer_port);
|
|
154
|
return $arr;
|
158
|
return $arr;
|
|
155
|
}
|
159
|
}
|
|
|
|
160
|
+
|
|
|
|
161
|
+ /**
|
|
|
|
162
|
+ * @name :(查询参数设置)selectParam
|
|
|
|
163
|
+ * @author :lyh
|
|
|
|
164
|
+ * @method :post
|
|
|
|
165
|
+ * @time :2023/6/14 15:00
|
|
|
|
166
|
+ */
|
|
|
|
167
|
+ public function selectParam(){
|
|
|
|
168
|
+ $select = [
|
|
|
|
169
|
+ 'gl_project.id AS user_id',
|
|
|
|
170
|
+ 'gl_project_deploy_build.test_domain AS test_domain',
|
|
|
|
171
|
+ 'gl_project_deploy_optimize.domain AS domain',
|
|
|
|
172
|
+ 'gl_project_deploy_build.project_id AS project_id',
|
|
|
|
173
|
+ 'gl_project.cooperate_date AS cooperate_date',
|
|
|
|
174
|
+ 'gl_project_deploy_build.service_duration AS service_duration',
|
|
|
|
175
|
+ ];
|
|
|
|
176
|
+ return $select;
|
|
|
|
177
|
+ }
|
|
156
|
} |
178
|
} |