作者 lyh

变更数据

... ... @@ -183,7 +183,7 @@ class AiBlogTask extends Command
ProjectServer::useProject($project_id);
$aiSettingInfo = $this->getSetting($project_id);
$this->output('sync: list start, project_id: ' . $project_id);
$this->updateBlogList($aiSettingInfo);
$this->updateBlogList($aiSettingInfo,$project_id);
$this->output('sync: list end');
//更新作者
$this->output('sync: author start, project_id: ' . $project_id);
... ... @@ -249,7 +249,7 @@ class AiBlogTask extends Command
* @param $aiSettingInfo
* @return bool
*/
public function updateBlogList($aiSettingInfo){
public function updateBlogList($aiSettingInfo,$project_id = 0){
$aiBlogService = new AiBlogService();
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
$aiBlogService->key = $aiSettingInfo['key'];
... ... @@ -257,6 +257,14 @@ class AiBlogTask extends Command
$saveData = [];
$result = $aiBlogService->getAiBlogList($page,15);
if(!isset($result['status']) || $result['status'] != 200){
// 钉钉通知
$dingService = new DingService();
$body = [
'keyword' => 'AI_BLOG列表页未生成拉取失败',
'msg' => '项目ID:' . $project_id . PHP_EOL . '返回信息:' . json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
'isAtAll' => false, // 是否@所有人
];
$dingService->handle($body);
return true;
}
$total_page = $result['data']['total_page'];
... ...