作者 李宇航

合并分支 'lyh-server' 到 'master'

变更数据



查看合并请求 !3157
@@ -151,7 +151,7 @@ class InquiryController extends BaseController @@ -151,7 +151,7 @@ class InquiryController extends BaseController
151 } 151 }
152 $result = ReInquiryCount::where('domain', 'like', '%'.$domain.'%')->first(); 152 $result = ReInquiryCount::where('domain', 'like', '%'.$domain.'%')->first();
153 if($result){ 153 if($result){
154 - $result->tasks = $result->tasks; //调用访问器 154 +
155 $return = 0; //所有都关闭或删除就不返回 155 $return = 0; //所有都关闭或删除就不返回
156 foreach ($result->tasks as $task){ 156 foreach ($result->tasks as $task){
157 $return += (!$task['is_del'] && $task['status']); 157 $return += (!$task['is_del'] && $task['status']);
@@ -26,55 +26,23 @@ class CountLogic extends BaseLogic @@ -26,55 +26,23 @@ class CountLogic extends BaseLogic
26 { 26 {
27 parent::__construct(); 27 parent::__construct();
28 $this->model = new Count(); 28 $this->model = new Count();
  29 + if($this->user['project_id'] == 5172){
  30 + $this->user['project_id'] = 3298;
  31 + }
29 } 32 }
30 33
31 /** 34 /**
32 - * @name :(昨日统计数据)yesterday_count 35 + * @name :昨日统计数据 yesterday_count
33 * @author :lyh 36 * @author :lyh
34 * @method :post 37 * @method :post
35 * @time :2023/5/23 17:30 38 * @time :2023/5/23 17:30
36 */ 39 */
37 public function yesterday_count(){ 40 public function yesterday_count(){
38 $yesterday = Carbon::yesterday()->toDateString(); 41 $yesterday = Carbon::yesterday()->toDateString();
39 - if($this->user['project_id'] == 5172){  
40 - $this->user['project_id'] = 3298;  
41 - }  
42 - $param = [  
43 - 'date' => $yesterday,  
44 - 'project_id' => $this->user['project_id']  
45 - ];  
46 - $info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);  
47 - if($info === false){  
48 - $info = $this->model->read(['project_id' => $this->user['project_id']],  
49 - ['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);  
50 - }  
51 - $inquiry_num = Cache::get('inquiry_num_'.$this->user['project_id']);  
52 - if(empty($inquiry_num)){  
53 - $domain = parse_url($this->user['domain'], PHP_URL_HOST); // 直接取域名部分  
54 - if($this->user['project_id'] == 5172){  
55 - $domain = 3298;  
56 - }  
57 - $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$this->user['is_upgrade']);  
58 - if($inquiry_list !== false){  
59 - if(isset($inquiry_list['status']) && $inquiry_list['status'] != 400){  
60 - $info['inquiry_num'] = $inquiry_list['data']['count'];  
61 - Cache::add('inquiry_num_'.$this->user['project_id'],$inquiry_list['data']['count'],3600);  
62 - }  
63 - }  
64 - }  
65 - //获取项目的剩余时长  
66 - $projectModel = new Project();  
67 - $projectInfo = $projectModel->read(['id'=>$this->user['project_id']],['remain_day','finish_remain_day']);  
68 - $info['service_day'] = $projectInfo['remain_day'];  
69 - $info['compliance_day'] = $projectInfo['finish_remain_day'];  
70 - return $this->success($info);  
71 - }  
72 42
73 - public function yesterday_5172_count(){  
74 - $yesterday = Carbon::yesterday()->toDateString();  
75 $param = [ 43 $param = [
76 'date' => $yesterday, 44 'date' => $yesterday,
77 - 'project_id' => 3298 45 + 'project_id' => $this->user['project_id']
78 ]; 46 ];
79 $info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']); 47 $info = $this->model->read($param,['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);
80 if($info === false){ 48 if($info === false){
@@ -235,6 +203,7 @@ class CountLogic extends BaseLogic @@ -235,6 +203,7 @@ class CountLogic extends BaseLogic
235 * @time :2023/5/24 15:56 203 * @time :2023/5/24 15:56
236 */ 204 */
237 public function access_country_count(){ 205 public function access_country_count(){
  206 +
238 $customerVisitModel = new Visit(); 207 $customerVisitModel = new Visit();
239 $data = $customerVisitModel->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) 208 $data = $customerVisitModel->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
240 ->groupBy('country') 209 ->groupBy('country')