|
...
|
...
|
@@ -148,52 +148,6 @@ class ComController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
public function ceshi(){
|
|
|
|
$deployModel = new DeployBuild();
|
|
|
|
$list = $deployModel->list();
|
|
|
|
$data = [];
|
|
|
|
$yesterday = Carbon::yesterday()->toDateString();
|
|
|
|
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);
|
|
|
|
if($inquiry_list['status'] == 400){
|
|
|
|
$arr['inquiry_num'] = 0;
|
|
|
|
}else{
|
|
|
|
$arr['inquiry_num'] = $inquiry_list['data']['total'];
|
|
|
|
//询盘国家统计
|
|
|
|
$countryData = $inquiry_list['data']['data'];
|
|
|
|
$countryArr = [];
|
|
|
|
foreach ($countryData as $v1){
|
|
|
|
if(isset($countryArr[$v1['country']])){
|
|
|
|
$countryArr[$v1['country']]++;
|
|
|
|
}else{
|
|
|
|
$countryArr[$v1['country']] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
arsort($countryArr);
|
|
|
|
|
|
|
|
$top20 = array_slice($countryArr, 0, 20, true);
|
|
|
|
|
|
|
|
$arr['country'] = json_encode($top20);
|
|
|
|
var_dump(json_decode($arr['country']));
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
$arr['date'] = $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;
|
|
|
|
}else{
|
|
|
|
$arr['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);
|
|
|
|
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|