|
...
|
...
|
@@ -26,55 +26,23 @@ class CountLogic extends BaseLogic |
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
$this->model = new Count();
|
|
|
|
if($this->user['project_id'] == 5172){
|
|
|
|
$this->user['project_id'] = 3298;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(昨日统计数据)yesterday_count
|
|
|
|
* @name :昨日统计数据 yesterday_count
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/23 17:30
|
|
|
|
*/
|
|
|
|
public function yesterday_count(){
|
|
|
|
$yesterday = Carbon::yesterday()->toDateString();
|
|
|
|
if($this->user['project_id'] == 5172){
|
|
|
|
$this->user['project_id'] = 3298;
|
|
|
|
}
|
|
|
|
$param = [
|
|
|
|
'date' => $yesterday,
|
|
|
|
'project_id' => $this->user['project_id']
|
|
|
|
];
|
|
|
|
$info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);
|
|
|
|
if($info === false){
|
|
|
|
$info = $this->model->read(['project_id' => $this->user['project_id']],
|
|
|
|
['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);
|
|
|
|
}
|
|
|
|
$inquiry_num = Cache::get('inquiry_num_'.$this->user['project_id']);
|
|
|
|
if(empty($inquiry_num)){
|
|
|
|
$domain = parse_url($this->user['domain'], PHP_URL_HOST); // 直接取域名部分
|
|
|
|
if($this->user['project_id'] == 5172){
|
|
|
|
$domain = 3298;
|
|
|
|
}
|
|
|
|
$inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$this->user['is_upgrade']);
|
|
|
|
if($inquiry_list !== false){
|
|
|
|
if(isset($inquiry_list['status']) && $inquiry_list['status'] != 400){
|
|
|
|
$info['inquiry_num'] = $inquiry_list['data']['count'];
|
|
|
|
Cache::add('inquiry_num_'.$this->user['project_id'],$inquiry_list['data']['count'],3600);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取项目的剩余时长
|
|
|
|
$projectModel = new Project();
|
|
|
|
$projectInfo = $projectModel->read(['id'=>$this->user['project_id']],['remain_day','finish_remain_day']);
|
|
|
|
$info['service_day'] = $projectInfo['remain_day'];
|
|
|
|
$info['compliance_day'] = $projectInfo['finish_remain_day'];
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function yesterday_5172_count(){
|
|
|
|
$yesterday = Carbon::yesterday()->toDateString();
|
|
|
|
$param = [
|
|
|
|
'date' => $yesterday,
|
|
|
|
'project_id' => 3298
|
|
|
|
'project_id' => $this->user['project_id']
|
|
|
|
];
|
|
|
|
$info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);
|
|
|
|
if($info === false){
|
|
...
|
...
|
@@ -235,6 +203,7 @@ class CountLogic extends BaseLogic |
|
|
|
* @time :2023/5/24 15:56
|
|
|
|
*/
|
|
|
|
public function access_country_count(){
|
|
|
|
|
|
|
|
$customerVisitModel = new Visit();
|
|
|
|
$data = $customerVisitModel->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
|
|
|
|
->groupBy('country')
|
...
|
...
|
|