CountController.php
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace App\Http\Controllers\Bside\HomeCount;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\HomeCount\CountLogic;
class CountController extends BaseController
{
const STATUS_ERROR = 400;
/**
* @name :(首页数据统计)yesterday_count
* @author :lyh
* @method :post
* @time :2023/5/23 17:23
*/
public function count(CountLogic $countLogic){
$data = [];
//TODO::昨日数据统计
$data['yesterday'] = $countLogic->yesterday_count();
//TODO::全球搜方案信息
$data['scheme_info'] = $countLogic->scheme_info();
//TODO::网站访问量统计
$data['total_visit'] = $countLogic->total_count(isset($data['yesterday']['inquiry_num']) ? $data['yesterday']['inquiry_num'] : '');
//TODO::关键字排名数据
$data['keyword_data'] = $countLogic->keyword_data_count();
//TODO::相关数据统计
$data['with_data'] = $countLogic->with_data_count();
//TODO::30天pv,ip统计
$data['visit_data'] = $countLogic->visit_data_count();
//TODO::询盘国家统计
$data['country_data'] = isset($data['yesterday']['country']) ? json_decode($data['yesterday']['country']) : '';
//TODO::来源排名
$data['referrer_count'] = $countLogic->referrer_count();
//TODO::访问国家前10
$data['access_country_count'] = $countLogic->access_country_count();
//TODO::企业中心服务
$data['enterprise_service'] = $countLogic->enterprise_service();
return $this->response('success',Code::SUCCESS,$data);
}
}