正在显示
1 个修改的文件
包含
12 行增加
和
13 行删除
| @@ -60,9 +60,6 @@ class AiVideoAutoPublish extends Command | @@ -60,9 +60,6 @@ class AiVideoAutoPublish extends Command | ||
| 60 | if($action == 'auto_save_video_task'){ | 60 | if($action == 'auto_save_video_task'){ |
| 61 | $this->auto_save_video_task(); | 61 | $this->auto_save_video_task(); |
| 62 | } | 62 | } |
| 63 | - if($action == 'getAiVideoParam'){ | ||
| 64 | - $this->getAiVideoParam(); | ||
| 65 | - } | ||
| 66 | } | 63 | } |
| 67 | 64 | ||
| 68 | /** | 65 | /** |
| @@ -76,7 +73,7 @@ class AiVideoAutoPublish extends Command | @@ -76,7 +73,7 @@ class AiVideoAutoPublish extends Command | ||
| 76 | $this->output('开始自动发布Video文章'); | 73 | $this->output('开始自动发布Video文章'); |
| 77 | $projectModel = new Project(); | 74 | $projectModel = new Project(); |
| 78 | $optimizeModel = new DeployOptimize(); | 75 | $optimizeModel = new DeployOptimize(); |
| 79 | - $projectList = $projectModel->list(['is_ai_video'=>1,'delete_status'=>0,'site_status'=>0,'extend_type'=>0],'id',['id']); | 76 | + $projectList = $projectModel->list(['is_ai_video'=>1,'id'=>3751,'delete_status'=>0,'site_status'=>0,'extend_type'=>0],'id',['id']); |
| 80 | foreach ($projectList as $item){ | 77 | foreach ($projectList as $item){ |
| 81 | $this->output("项目{$item['id']}开始自动发布"); | 78 | $this->output("项目{$item['id']}开始自动发布"); |
| 82 | //获取当前是否开启自动发布aiVideo | 79 | //获取当前是否开启自动发布aiVideo |
| @@ -97,20 +94,22 @@ class AiVideoAutoPublish extends Command | @@ -97,20 +94,22 @@ class AiVideoAutoPublish extends Command | ||
| 97 | } | 94 | } |
| 98 | if($item['project_type'] == 1){ | 95 | if($item['project_type'] == 1){ |
| 99 | //todo::页面上获取数据 | 96 | //todo::页面上获取数据 |
| 97 | + $data = $this->getAiVideoParam($item['id']); | ||
| 100 | }else{ | 98 | }else{ |
| 101 | //获取当前网站的标题 | 99 | //获取当前网站的标题 |
| 102 | ProjectServer::useProject($item['id']); | 100 | ProjectServer::useProject($item['id']); |
| 103 | $data = $this->getVideoInfo(); | 101 | $data = $this->getVideoInfo(); |
| 104 | - if(!empty($data)){ | ||
| 105 | - //写入一条零时生成视频记录 | ||
| 106 | - $aiVideoAutoLogModel = new AiVideoAutoLog(); | ||
| 107 | - $aiVideoAutoLogModel->addReturnId( | ||
| 108 | - ['project_id'=>$item['id'],'title'=>$data['title'],'remark'=>$data['remark'],'images'=>json_encode($data['images'],true),'date'=>date('Y-m-d')] | ||
| 109 | - ); | ||
| 110 | - } | 102 | + DB::disconnect('custom_mysql'); |
| 103 | + } | ||
| 104 | + if(!empty($data)){ | ||
| 105 | + //写入一条零时生成视频记录 | ||
| 106 | + $aiVideoAutoLogModel = new AiVideoAutoLog(); | ||
| 107 | + $aiVideoAutoLogModel->addReturnId( | ||
| 108 | + ['project_id'=>$item['id'],'title'=>$data['title'],'remark'=>$data['remark'],'images'=>json_encode($data['images'],true),'date'=>date('Y-m-d')] | ||
| 109 | + ); | ||
| 111 | } | 110 | } |
| 112 | - DB::disconnect('custom_mysql'); | ||
| 113 | } | 111 | } |
| 112 | + return true; | ||
| 114 | } | 113 | } |
| 115 | 114 | ||
| 116 | /** | 115 | /** |
| @@ -328,9 +327,9 @@ class AiVideoAutoPublish extends Command | @@ -328,9 +327,9 @@ class AiVideoAutoPublish extends Command | ||
| 328 | $num++; | 327 | $num++; |
| 329 | goto AGAIN; | 328 | goto AGAIN; |
| 330 | } | 329 | } |
| 331 | - dd(['title'=>$title,'remark'=>$content,'images'=>$images]); | ||
| 332 | return ['title'=>$title,'remark'=>$content,'images'=>$images]; | 330 | return ['title'=>$title,'remark'=>$content,'images'=>$images]; |
| 333 | } catch (\Exception $e) { | 331 | } catch (\Exception $e) { |
| 332 | + $this->output('project_id: ' . $project_id . ', domain: ' . $domain . ', error: ' . $e->getMessage()); | ||
| 334 | echo 'project_id: ' . $project_id . ', domain: ' . $domain . ', error: ' . $e->getMessage() . PHP_EOL; | 333 | echo 'project_id: ' . $project_id . ', domain: ' . $domain . ', error: ' . $e->getMessage() . PHP_EOL; |
| 335 | } | 334 | } |
| 336 | } | 335 | } |
-
请 注册 或 登录 后发表评论