作者 lyh

gx

@@ -90,11 +90,18 @@ class AiBlogService @@ -90,11 +90,18 @@ class AiBlogService
90 * @author :lyh 90 * @author :lyh
91 * @method :post 91 * @method :post
92 * @time :2025/2/13 14:39 92 * @time :2025/2/13 14:39
93 - * @param :type=(1作者2文章) keyword=关键词 subtype=blog url=回调url , title=标题 93 + * @param :type=(1作者2文章) keyword=关键词 subtype=blog url=回调url , $title = ''
94 */ 94 */
95 public function createTask($keyword,$type = 2,$subtype = 'Blog',$anchor = [],$title = ''){ 95 public function createTask($keyword,$type = 2,$subtype = 'Blog',$anchor = [],$title = ''){
96 $request_url = $this->url.'api/task/create'; 96 $request_url = $this->url.'api/task/create';
97 - $param = ['keyword'=>$keyword, 'type'=>$type, 'subtype'=>$subtype,'anchor'=>$anchor,'title'=>$title,'url'=>$this->route,'mch_id'=>$this->mch_id,'template_id'=>1]; 97 + $param = ['keyword'=>$keyword, 'type'=>$type, 'subtype'=>$subtype];
  98 + if(!empty($title)){
  99 + $param['title'] = $title;
  100 + }
  101 + $param['anchor'] = $anchor;
  102 + $param['url'] = $this->route;
  103 + $param['mch_id'] = $this->mch_id;
  104 + $param['template_id'] = 1;
98 $this->sign = $this->generateSign($param,$this->key); 105 $this->sign = $this->generateSign($param,$this->key);
99 $param['sign'] = $this->sign; 106 $param['sign'] = $this->sign;
100 $result = http_post($request_url,json_encode($param,true)); 107 $result = http_post($request_url,json_encode($param,true));