|
...
|
...
|
@@ -73,7 +73,7 @@ class AiVideoAutoPublish extends Command |
|
|
|
$this->output('开始自动发布Video文章');
|
|
|
|
$projectModel = new Project();
|
|
|
|
$optimizeModel = new DeployOptimize();
|
|
|
|
$projectList = $projectModel->list(['is_ai_video'=>1,'delete_status'=>0,'site_status'=>0,'extend_type'=>0],'id',['id','project_type']);
|
|
|
|
$projectList = $projectModel->list(['is_ai_video'=>1,'id'=>1,'delete_status'=>0,'site_status'=>0,'extend_type'=>0],'id',['id','project_type']);
|
|
|
|
foreach ($projectList as $item){
|
|
|
|
$this->output("项目{$item['id']}开始自动发布");
|
|
|
|
//获取当前是否开启自动发布aiVideo
|
|
...
|
...
|
@@ -121,7 +121,7 @@ class AiVideoAutoPublish extends Command |
|
|
|
*/
|
|
|
|
public function getVideoInfo(){
|
|
|
|
$data = [];
|
|
|
|
$random = 2;
|
|
|
|
$random = rand(1, 2);
|
|
|
|
if($random == 1){//取产品
|
|
|
|
$productModel = new Product();
|
|
|
|
$info = $productModel->formatQuery(['status'=>1,'title'=>['!=',null],'intro'=>['!=',null]])->select(['title','gallery','intro'])->inRandomOrder()->first();
|
|
...
|
...
|
@@ -247,7 +247,8 @@ class AiVideoAutoPublish extends Command |
|
|
|
$aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$info['project_id'],'storage'=>$storage]);
|
|
|
|
ProjectServer::useProject($info['project_id']);
|
|
|
|
$aiVideoModel = new AiVideo();
|
|
|
|
$aiVideoModel->addReturnId(['title'=>$info['title'],'task_id'=>$result['data']['task_id'],'description'=>$info['remark'],'project_id'=>$info['project_id'],'images'=>json_encode($info['images'],true),'anchor'=>json_encode([],true)]);
|
|
|
|
$next_auto_date = date('Y-m-d', strtotime('+' . mt_rand(5,7) . 'days')); //每5-7天自动发布
|
|
|
|
$aiVideoModel->addReturnId(['next_auto_date'=>$next_auto_date,'title'=>$info['title'],'task_id'=>$result['data']['task_id'],'description'=>$info['remark'],'project_id'=>$info['project_id'],'images'=>json_encode($info['images'],true),'anchor'=>json_encode([],true)]);
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
$aiVideoAutoLogModel->edit(['status'=>2],['id'=>$info['id']]);
|
|
|
|
}
|
...
|
...
|
|