作者 lyh

gx

@@ -109,7 +109,7 @@ class AiBlogLogic extends BaseLogic @@ -109,7 +109,7 @@ class AiBlogLogic extends BaseLogic
109 $aiBlogService->mch_id = $aiSettingInfo['mch_id']; 109 $aiBlogService->mch_id = $aiSettingInfo['mch_id'];
110 $aiBlogService->key = $aiSettingInfo['key']; 110 $aiBlogService->key = $aiSettingInfo['key'];
111 $aiBlogService->route = generateRoute(Translate::tran($this->param['keyword'], 'en')); 111 $aiBlogService->route = generateRoute(Translate::tran($this->param['keyword'], 'en'));
112 - $result = $aiBlogService->createTask($this->param['keyword'],2,'blog',$this->param['anchor'] ?? []); 112 + $result = $aiBlogService->createTask($this->param['keyword'],2,'blog',$this->param['anchor'] ?? [],$this->param['title'] ?? '');
113 if($result['status'] == 200){ 113 if($result['status'] == 200){
114 $aiBlogTaskModel = new AiBlogTask(); 114 $aiBlogTaskModel = new AiBlogTask();
115 $aiBlogTaskModel->addReturnId(['project_id'=>$this->user['project_id'],'type'=>2,'task_id'=>$result['data']['task_id'],'status'=>1]); 115 $aiBlogTaskModel->addReturnId(['project_id'=>$this->user['project_id'],'type'=>2,'task_id'=>$result['data']['task_id'],'status'=>1]);
@@ -92,15 +92,14 @@ class AiBlogService @@ -92,15 +92,14 @@ class AiBlogService
92 * @author :lyh 92 * @author :lyh
93 * @method :post 93 * @method :post
94 * @time :2025/2/13 14:39 94 * @time :2025/2/13 14:39
95 - * @param :type=(1作者2文章) keyword=关键词 subtype=blog url=回调url 95 + * @param :type=(1作者2文章) keyword=关键词 subtype=blog url=回调url , $title = ''
96 */ 96 */
97 - public function createTask($keyword,$type = 2,$subtype = 'Blog',$anchor = []){ 97 + public function createTask($keyword,$type = 2,$subtype = 'Blog',$anchor = [],$title = ''){
98 $request_url = $this->url.'api/task/create'; 98 $request_url = $this->url.'api/task/create';
99 - $param = [  
100 - 'keyword'=>$keyword,  
101 - 'type'=>$type,  
102 - 'subtype'=>$subtype,  
103 - ]; 99 + $param = ['keyword'=>$keyword, 'type'=>$type, 'subtype'=>$subtype,];
  100 + if(!empty($title)){
  101 + $param['title'] = $title;
  102 + }
104 $param['anchor'] = $anchor; 103 $param['anchor'] = $anchor;
105 $param['url'] = $this->route; 104 $param['url'] = $this->route;
106 $param['mch_id'] = $this->mch_id; 105 $param['mch_id'] = $this->mch_id;