作者 李宇航

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

Lyh server



查看合并请求 !2984
@@ -62,11 +62,11 @@ class GeoCount extends Command @@ -62,11 +62,11 @@ class GeoCount extends Command
62 if(empty($project_id)){ 62 if(empty($project_id)){
63 return true; 63 return true;
64 } 64 }
65 - $projectModel = new Project();  
66 - $geo_qualify_day = $projectModel->getValue(['id'=>$project_id],'geo_qualify_day');  
67 $geoQuestionResModel = new GeoQuestionResult(); 65 $geoQuestionResModel = new GeoQuestionResult();
68 $platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude']; 66 $platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude'];
69 foreach ($project_id as $item){ 67 foreach ($project_id as $item){
  68 + $projectModel = new Project();
  69 + $geo_qualify_day = $projectModel->getValue(['id'=>$item],'geo_qualify_day');
70 $this->output('执行的项目ID----'.$item); 70 $this->output('执行的项目ID----'.$item);
71 //收录总数 71 //收录总数
72 $total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]); 72 $total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]);
@@ -66,11 +66,11 @@ class GeoCountAll extends Command @@ -66,11 +66,11 @@ class GeoCountAll extends Command
66 if(empty($project_id)){ 66 if(empty($project_id)){
67 return true; 67 return true;
68 } 68 }
69 - $projectModel = new Project();  
70 - $geo_qualify_day = $projectModel->getValue(['id'=>$project_id],'geo_qualify_day');  
71 $geoQuestionResModel = new GeoQuestionLog(); 69 $geoQuestionResModel = new GeoQuestionLog();
72 $platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude']; 70 $platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude'];
73 foreach ($project_id as $item){ 71 foreach ($project_id as $item){
  72 + $projectModel = new Project();
  73 + $geo_qualify_day = $projectModel->getValue(['id'=>$item],'geo_qualify_day');
74 $this->output('执行的项目ID----'.$item); 74 $this->output('执行的项目ID----'.$item);
75 //收录总数 75 //收录总数
76 $total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]); 76 $total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]);
@@ -6,6 +6,7 @@ namespace App\Http\Logic\Bside\HomeCount; @@ -6,6 +6,7 @@ namespace App\Http\Logic\Bside\HomeCount;
6 use App\Helper\FormGlobalsoApi; 6 use App\Helper\FormGlobalsoApi;
7 use App\Http\Logic\Bside\BaseLogic; 7 use App\Http\Logic\Bside\BaseLogic;
8 use App\Models\Geo\GeoCount; 8 use App\Models\Geo\GeoCount;
  9 +use App\Models\RankData\RankDataBmseo;
9 use App\Models\Template\BCustomTemplate; 10 use App\Models\Template\BCustomTemplate;
10 use App\Models\Visit\Visit; 11 use App\Models\Visit\Visit;
11 use App\Models\Visit\VisitItem; 12 use App\Models\Visit\VisitItem;
@@ -104,7 +105,11 @@ class CountLogic extends BaseLogic @@ -104,7 +105,11 @@ class CountLogic extends BaseLogic
104 public function keyword_data_count(){ 105 public function keyword_data_count(){
105 $version = $this->project['version'] ?? ''; 106 $version = $this->project['version'] ?? '';
106 $yesterday = date('Y-m-d'); 107 $yesterday = date('Y-m-d');
107 - $rankDataModel = new RankDataModel(); 108 + if($this->user['project_seo_type'] == 1){
  109 + $rankDataModel = new RankDataBmseo();
  110 + }else{
  111 + $rankDataModel = new RankDataModel();
  112 + }
108 $param = [ 113 $param = [
109 'updated_date' => $yesterday, 114 'updated_date' => $yesterday,
110 'project_id' => $this->user['project_id'] 115 'project_id' => $this->user['project_id']
@@ -122,10 +127,8 @@ class CountLogic extends BaseLogic @@ -122,10 +127,8 @@ class CountLogic extends BaseLogic
122 if(!empty($version) && $version != '7.5'){ 127 if(!empty($version) && $version != '7.5'){
123 $geoCountModel = new GeoCount(); 128 $geoCountModel = new GeoCount();
124 $geoInfo = $geoCountModel->where('project_id',$this->user['project_id'])->where('date', '<=', date('Y-m-d'))->orderBy('date', 'desc')->first(); 129 $geoInfo = $geoCountModel->where('project_id',$this->user['project_id'])->where('date', '<=', date('Y-m-d'))->orderBy('date', 'desc')->first();
125 - if($geoInfo !== false){  
126 - $data['geo_qualify_total'] = $geoInfo['qualify_total'];  
127 - $data['total_count'] = $geoInfo['qualify_total'] + $data['geo_qualify_total'];  
128 - } 130 + $data['geo_qualify_total'] = $geoInfo['qualify_total'] ?? 0;
  131 + $data['total_count'] = ($this->project['deploy_build']['keyword_num'] ?? 0) + ($this->project['geo_qualify_day'] ?? 0);
129 } 132 }
130 return $this->success($data); 133 return $this->success($data);
131 } 134 }