作者 lyh

gx

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