|
...
|
...
|
@@ -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']]);
|
|
|
|
}
|
...
|
...
|
|