|
...
|
...
|
@@ -63,7 +63,7 @@ class AiVideoAutoPublish extends Command |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :普通项目--自动发布
|
|
|
|
* @remark :自动发布aiVideo组装数据(写入一条记录)
|
|
|
|
* @name :auto_six_publish
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
...
|
...
|
@@ -241,13 +241,16 @@ class AiVideoAutoPublish extends Command |
|
|
|
$aiVideoService = new AiVideoService($info['project_id']);
|
|
|
|
$projectModel = new DeployOptimize();
|
|
|
|
$video_setting = $projectModel->getValue(['project_id'=>$info['project_id']],'video_setting');
|
|
|
|
$frequency_setting = $projectModel->getValue(['project_id'=>$info['project_id']],'send_ai_video_frequency');
|
|
|
|
$storage = $aiVideoTaskModel->videoSetting()[$video_setting ?? 1];
|
|
|
|
$frequency = $aiVideoTaskModel->videoFrequency()[$frequency_setting ?? 1];
|
|
|
|
$frequencyArr = explode('-',$frequency);
|
|
|
|
$result = $aiVideoService->createTask($info['title'],$info['remark'],$info['images'],[],$storage);
|
|
|
|
if($result['status'] == 200){
|
|
|
|
$aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$info['project_id'],'storage'=>$storage]);
|
|
|
|
ProjectServer::useProject($info['project_id']);
|
|
|
|
$aiVideoModel = new AiVideo();
|
|
|
|
$next_auto_date = date('Y-m-d', strtotime('+' . mt_rand(5,7) . 'days')); //每5-7天自动发布
|
|
|
|
$next_auto_date = date('Y-m-d', strtotime('+' . mt_rand($frequencyArr[0],$frequencyArr[1]) . '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']]);
|
|
...
|
...
|
@@ -289,7 +292,7 @@ class AiVideoAutoPublish extends Command |
|
|
|
* @method :post
|
|
|
|
* @time :2025/8/1 16:25
|
|
|
|
*/
|
|
|
|
public function getAiVideoParam($project_id = 3751)
|
|
|
|
public function getAiVideoParam($project_id)
|
|
|
|
{
|
|
|
|
//获取当前网站域名
|
|
|
|
$domainModel = new DomainInfo();
|
...
|
...
|
|