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