作者 赵彬吉
@@ -23,6 +23,7 @@ use App\Models\Devops\Servers; @@ -23,6 +23,7 @@ use App\Models\Devops\Servers;
23 use App\Models\Devops\ServersIp; 23 use App\Models\Devops\ServersIp;
24 use App\Models\Domain\DomainInfo; 24 use App\Models\Domain\DomainInfo;
25 use App\Models\Domain\DomainInfo as DomainInfoModel; 25 use App\Models\Domain\DomainInfo as DomainInfoModel;
  26 +use App\Models\Geo\GeoQuestionResult;
26 use App\Models\Industry\ProjectIndustryRelated; 27 use App\Models\Industry\ProjectIndustryRelated;
27 use App\Models\Inquiry\InquiryIP; 28 use App\Models\Inquiry\InquiryIP;
28 use App\Models\Inquiry\InquirySet; 29 use App\Models\Inquiry\InquirySet;
@@ -122,7 +123,10 @@ class ProjectLogic extends BaseLogic @@ -122,7 +123,10 @@ class ProjectLogic extends BaseLogic
122 $info['collect_test_domain'] = $info['is_upgrade'] ? CollectLog::getCollectTestDomain($id) : ''; 123 $info['collect_test_domain'] = $info['is_upgrade'] ? CollectLog::getCollectTestDomain($id) : '';
123 //获取项目所属行业 124 //获取项目所属行业
124 $info['deploy_optimize']['industry'] = ProjectIndustryRelated::where('project_id', $id)->pluck('industry_id')->toArray(); 125 $info['deploy_optimize']['industry'] = ProjectIndustryRelated::where('project_id', $id)->pluck('industry_id')->toArray();
125 - 126 + $questionModel = new GeoQuestionResult();
  127 + $info['question_qualify_count'] = $questionModel->where('project_id', $id)
  128 + ->where('hit','!=',0)->whereIn('platform',['openai', 'gemini','google_ai_overview'])
  129 + ->count();
126 return $this->success($info); 130 return $this->success($info);
127 } 131 }
128 132
@@ -180,7 +180,7 @@ class AiBlogLogic extends BaseLogic @@ -180,7 +180,7 @@ class AiBlogLogic extends BaseLogic
180 //推送到ai的数据结构 180 //推送到ai的数据结构
181 $data = [ 181 $data = [
182 'title'=>$param['new_title'], 'thumb'=>$param['image'], 'foreword'=>$param['description'] ?? '', 182 'title'=>$param['new_title'], 'thumb'=>$param['image'], 'foreword'=>$param['description'] ?? '',
183 - 'author_id'=>$this->param['author_id'], 'url'=>$param['route'], 183 + 'author_id'=>$param['author_id'], 'url'=>$param['route'],
184 ]; 184 ];
185 if(!isset($param['description']) || empty($param['description'])){ 185 if(!isset($param['description']) || empty($param['description'])){
186 $param['description'] = truncate_text($param['text']); 186 $param['description'] = truncate_text($param['text']);
@@ -217,10 +217,12 @@ class AiBlogLogic extends BaseLogic @@ -217,10 +217,12 @@ class AiBlogLogic extends BaseLogic
217 } 217 }
218 $aiBlogService = new AiBlogService($this->user['project_id']); 218 $aiBlogService = new AiBlogService($this->user['project_id']);
219 $result = $aiBlogService->createCustomBlog($data); 219 $result = $aiBlogService->createCustomBlog($data);
  220 + $this->model->edit(['task_id'=>$result['data']['task_id'] ?? '','status'=>$this->model::STATUS_FINISH],['id'=>$id]);
220 if(isset($result['status']) && $result['status'] == 200){ 221 if(isset($result['status']) && $result['status'] == 200){
221 - $this->model->edit(['task_id'=>$result['data']['task_id'],'status'=>$this->model::STATUS_FINISH],['id'=>$id]);  
222 //todo::更新列表页 222 //todo::更新列表页
223 shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &"); 223 shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &");
  224 + }else{
  225 + $this->fail('发布失败,请编辑后重新发布');
224 } 226 }
225 return $this->success(); 227 return $this->success();
226 } 228 }