作者 lyh

gx复制项目脚本

@@ -120,7 +120,13 @@ class AiBlogLogic extends BaseLogic @@ -120,7 +120,13 @@ class AiBlogLogic extends BaseLogic
120 */ 120 */
121 public function blogDelete(){ 121 public function blogDelete(){
122 try { 122 try {
  123 + $aiSettingInfo = $this->getProjectAiSetting();
  124 + $aiBlogService = new AiBlogService();
123 foreach ($this->param['ids'] as $id) { 125 foreach ($this->param['ids'] as $id) {
  126 + $info = $this->model->read(['id'=>$id],['task_id']);
  127 + $aiBlogService->mch_id = $aiSettingInfo['mch_id'];
  128 + $aiBlogService->key = $aiSettingInfo['key'];
  129 + $aiBlogService->delDetail($info['task_id']);
124 //删除路由映射 130 //删除路由映射
125 RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']); 131 RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']);
126 $this->model->del(['id'=>$id]); 132 $this->model->del(['id'=>$id]);
@@ -233,4 +233,22 @@ class AiBlogService @@ -233,4 +233,22 @@ class AiBlogService
233 $result = http_post($request_url,json_encode($param,true)); 233 $result = http_post($request_url,json_encode($param,true));
234 return $result; 234 return $result;
235 } 235 }
  236 +
  237 + /**
  238 + * @remark :删除文章
  239 + * @name :updateAuthorInfo
  240 + * @author :lyh
  241 + * @method :post
  242 + * @time :2025/3/4 16:22
  243 + * @param :task_id
  244 + */
  245 + public function delDetail($task_id){
  246 + $param['task_id'] = $task_id;
  247 + $request_url = $this->url.'api/result/delete';
  248 + $param['mch_id'] = $this->mch_id;
  249 + $this->sign = $this->generateSign($param,$this->key);
  250 + $param['sign'] = $this->sign;
  251 + $result = http_post($request_url,json_encode($param,true));
  252 + return $result;
  253 + }
236 } 254 }