|
@@ -63,7 +63,7 @@ class AiVideoAutoPublish extends Command |
|
@@ -63,7 +63,7 @@ class AiVideoAutoPublish extends Command |
|
63
|
}
|
63
|
}
|
|
64
|
|
64
|
|
|
65
|
/**
|
65
|
/**
|
|
66
|
- * @remark :普通项目--自动发布
|
66
|
+ * @remark :自动发布aiVideo组装数据(写入一条记录)
|
|
67
|
* @name :auto_six_publish
|
67
|
* @name :auto_six_publish
|
|
68
|
* @author :lyh
|
68
|
* @author :lyh
|
|
69
|
* @method :post
|
69
|
* @method :post
|
|
@@ -241,13 +241,16 @@ class AiVideoAutoPublish extends Command |
|
@@ -241,13 +241,16 @@ class AiVideoAutoPublish extends Command |
|
241
|
$aiVideoService = new AiVideoService($info['project_id']);
|
241
|
$aiVideoService = new AiVideoService($info['project_id']);
|
|
242
|
$projectModel = new DeployOptimize();
|
242
|
$projectModel = new DeployOptimize();
|
|
243
|
$video_setting = $projectModel->getValue(['project_id'=>$info['project_id']],'video_setting');
|
243
|
$video_setting = $projectModel->getValue(['project_id'=>$info['project_id']],'video_setting');
|
|
|
|
244
|
+ $frequency_setting = $projectModel->getValue(['project_id'=>$info['project_id']],'send_ai_video_frequency');
|
|
244
|
$storage = $aiVideoTaskModel->videoSetting()[$video_setting ?? 1];
|
245
|
$storage = $aiVideoTaskModel->videoSetting()[$video_setting ?? 1];
|
|
|
|
246
|
+ $frequency = $aiVideoTaskModel->videoFrequency()[$frequency_setting ?? 1];
|
|
|
|
247
|
+ $frequencyArr = explode('-',$frequency);
|
|
245
|
$result = $aiVideoService->createTask($info['title'],$info['remark'],$info['images'],[],$storage);
|
248
|
$result = $aiVideoService->createTask($info['title'],$info['remark'],$info['images'],[],$storage);
|
|
246
|
if($result['status'] == 200){
|
249
|
if($result['status'] == 200){
|
|
247
|
$aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$info['project_id'],'storage'=>$storage]);
|
250
|
$aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$info['project_id'],'storage'=>$storage]);
|
|
248
|
ProjectServer::useProject($info['project_id']);
|
251
|
ProjectServer::useProject($info['project_id']);
|
|
249
|
$aiVideoModel = new AiVideo();
|
252
|
$aiVideoModel = new AiVideo();
|
|
250
|
- $next_auto_date = date('Y-m-d', strtotime('+' . mt_rand(5,7) . 'days')); //每5-7天自动发布
|
253
|
+ $next_auto_date = date('Y-m-d', strtotime('+' . mt_rand($frequencyArr[0],$frequencyArr[1]) . 'days')); //每5-7天自动发布
|
|
251
|
$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)]);
|
254
|
$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)]);
|
|
252
|
DB::disconnect('custom_mysql');
|
255
|
DB::disconnect('custom_mysql');
|
|
253
|
$aiVideoAutoLogModel->edit(['status'=>2],['id'=>$info['id']]);
|
256
|
$aiVideoAutoLogModel->edit(['status'=>2],['id'=>$info['id']]);
|
|
@@ -289,7 +292,7 @@ class AiVideoAutoPublish extends Command |
|
@@ -289,7 +292,7 @@ class AiVideoAutoPublish extends Command |
|
289
|
* @method :post
|
292
|
* @method :post
|
|
290
|
* @time :2025/8/1 16:25
|
293
|
* @time :2025/8/1 16:25
|
|
291
|
*/
|
294
|
*/
|
|
292
|
- public function getAiVideoParam($project_id = 3751)
|
295
|
+ public function getAiVideoParam($project_id)
|
|
293
|
{
|
296
|
{
|
|
294
|
//获取当前网站域名
|
297
|
//获取当前网站域名
|
|
295
|
$domainModel = new DomainInfo();
|
298
|
$domainModel = new DomainInfo();
|