|
...
|
...
|
@@ -43,11 +43,64 @@ class Yesterday extends Command |
|
|
|
foreach ($list as $v){
|
|
|
|
$v['test_domain'] = 'https://demomark.globalso.com/';
|
|
|
|
$arr = [];
|
|
|
|
$arr['pv_num'] = DB::table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->where('domain',$v['test_domain'])->count();
|
|
|
|
$arr['ip_num'] = DB::table('gl_customer_visit')->whereDate('updated_date', $yesterday)->where('domain',$v['test_domain'])->count();
|
|
|
|
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($v['test_domain'],'',1,100000000);
|
|
|
|
//统计时间
|
|
|
|
$arr['date'] = $yesterday;
|
|
|
|
//pv统计
|
|
|
|
$arr['pv_num'] = $this->pv_num($yesterday,$v['test_domain']);
|
|
|
|
//ip统计
|
|
|
|
$arr['ip_num'] = $this->ip_num($yesterday,$v['test_domain']);
|
|
|
|
//询盘统计
|
|
|
|
$arr = $this->inquiry($arr,$v['test_domain']);
|
|
|
|
//服务达标天数
|
|
|
|
$arr['compliance_day'] = $this->compliance_day($yesterday);
|
|
|
|
//剩余服务时常
|
|
|
|
$arr['service_day'] = $v['service_duration'] - Common::getDaysToTargetDate($v['created_at']);
|
|
|
|
//项目id
|
|
|
|
$arr['project_id'] = $v['project_id'];
|
|
|
|
$arr['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
$arr['updated_at'] = date('Y-m-d H:i:s');
|
|
|
|
$data[] = $arr;
|
|
|
|
}
|
|
|
|
//判断数据是否存在
|
|
|
|
DB::table('gl_count')->insert($data);
|
|
|
|
echo $this->error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(统计pv)pv_num
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/14 15:40
|
|
|
|
*/
|
|
|
|
public function pv_num($yesterday,$domain){
|
|
|
|
$pv = DB::table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->where('domain',$domain)->count();
|
|
|
|
return $pv;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(统计pv)pv_num
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/14 15:40
|
|
|
|
*/
|
|
|
|
public function ip_num($yesterday,$domain){
|
|
|
|
$ip = DB::table('gl_customer_visit')->whereDate('updated_date', $yesterday)->where('domain',$domain)->count();
|
|
|
|
return $ip;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $arr
|
|
|
|
* @param $domain
|
|
|
|
* @name :(询盘统计)inquiry
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/14 15:44
|
|
|
|
*/
|
|
|
|
public function inquiry($arr,$domain){
|
|
|
|
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
|
|
|
|
if($inquiry_list['status'] == self::STATUS_ERROR){
|
|
|
|
$arr['inquiry_num'] = 0;
|
|
|
|
$arr['country'] = '';
|
|
|
|
}else{
|
|
|
|
$arr['inquiry_num'] = $inquiry_list['data']['total'];
|
|
|
|
//询盘国家统计
|
|
...
|
...
|
@@ -64,21 +117,24 @@ class Yesterday extends Command |
|
|
|
$top20 = array_slice($countryArr, 0, 20, true);
|
|
|
|
$arr['country'] = json_encode($top20);
|
|
|
|
}
|
|
|
|
$arr['date'] = $yesterday;
|
|
|
|
return $arr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $yesterday
|
|
|
|
* @name :(服务达标天数)compliance_day
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/14 15:48
|
|
|
|
*/
|
|
|
|
public function compliance_day($yesterday){
|
|
|
|
//服务达标天数
|
|
|
|
$rank_info = DB::table('gl_rank_data')->where(['updated_date'=>$yesterday,'lang'=>''])->select(['compliance_day'])->first();
|
|
|
|
if(empty($rank_info)){
|
|
|
|
$arr['compliance_day'] = 0;
|
|
|
|
$compliance_day = 0;
|
|
|
|
}else{
|
|
|
|
$arr['compliance_day'] = $rank_info->compliance_day;
|
|
|
|
$compliance_day = $rank_info->compliance_day;
|
|
|
|
}
|
|
|
|
$arr['service_day'] = $v['service_duration'] - Common::getDaysToTargetDate($v['created_at']);
|
|
|
|
$arr['project_id'] = $v['project_id'];
|
|
|
|
$arr['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
$arr['updated_at'] = date('Y-m-d H:i:s');
|
|
|
|
$data[] = $arr;
|
|
|
|
}
|
|
|
|
//判断数据是否存在
|
|
|
|
DB::table('gl_count')->insert($data);
|
|
|
|
echo $this->error;
|
|
|
|
return $compliance_day;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|