作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -96,7 +96,7 @@ class AiBlogTask extends Command
];
$dingService->handle($body);
}
echo date('Y-m-d H:i:s'). '错误信息:'.json_encode($result,true).PHP_EOL;
echo date('Y-m-d H:i:s'). '错误信息:'.json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).PHP_EOL;
return false;
}
//保存当前项目ai_blog数据
... ... @@ -104,8 +104,16 @@ class AiBlogTask extends Command
$aiBlogModel = new AiBlog();
$aiBlogInfo = $aiBlogModel->read(['task_id'=>$item['task_id']],['id']);
if($aiBlogInfo === false){
// 钉钉通知
$dingService = new DingService();
$body = [
'keyword' => 'AI_BLOG生成错误',
'msg' => '子任务不存在:'.$item['task_id'],
'isAtAll' => false, // 是否@所有人
];
$dingService->handle($body);
echo '任务id不存在:'.$item['task_id'].PHP_EOL;
$aiBlogTaskModel->edit(['status'=>$aiBlogModel::STATUS_FINISH],['id'=>$item['id']]);
$aiBlogTaskModel->edit(['status'=>9],['id'=>$item['id']]);
DB::disconnect('custom_mysql');
return false;
}
... ...
... ... @@ -556,12 +556,12 @@ class OptimizeController extends BaseController
]);
ProjectServer::useProject($this->param['project_id']);
$aiBlogModel = new AiBlog();
$list = $aiBlogModel->list(['anchor'=>['!=',null]],'id',['route']);
$list = $aiBlogModel->formatQuery(['anchor'=>['!=',null]])->pluck('route')->toArray();
if(!empty($list)){
$domainModel = new DomainInfo();
$DomainInfo = $domainModel->read(['project_id'=>$this->param['project_id']]);
foreach ($list as $k => $v){
$v['route'] = ('https://'.$DomainInfo['domain'] ?? ''.'/') . 'blog/' . $v['route'];
$v = ('https://'.$DomainInfo['domain'] ?? ''.'/') . 'blog/' . $v;
$list[$k] = $v;
}
}
... ...