作者 李宇航

合并分支 'master-lyh-edit' 到 'master'

修改关键字生成视频



查看合并请求 !574
... ... @@ -87,7 +87,7 @@ class VideoTask extends Command
continue;
}
ProjectServer::useProject($task_project->project_id);
$keyword = $this->getProjectKeyword($task_project->number);
$keyword = $this->getProjectKeyword($task_project->num);
// 已经没有需要生成视频的关键词
if (!$keyword) {
$task_project->status = KeywordVideoTask::STATUS_CLOSE;
... ... @@ -95,7 +95,13 @@ class VideoTask extends Command
continue;
}
$logo_bg = $this->getImage($domainInfo);
$num = $task_project->num;
foreach ($keyword as $val) {
if($sub_task_num == 0){
$task_project->num = $num;
$task_project->save();
break;
}
$log = KeywordVideoTaskLog::where(['project_id' => $task_project->project_id, 'keyword_id' => $val->id])->first();
if ($log){
continue;
... ... @@ -114,11 +120,15 @@ class VideoTask extends Command
'created_at' => date('Y-m-d H:i:s'),
];
KeywordVideoTaskLog::insert($array);
$num--;
$sub_task_num--;
}
}
$task_project->status = KeywordVideoTask::STATUS_CLOSE;
$task_project->save();
if($sub_task_num != 0){
$task_project->num = 0;
$task_project->status = KeywordVideoTask::STATUS_CLOSE;
$task_project->save();
}
}
return true;
}
... ...
... ... @@ -108,7 +108,7 @@ class KeywordVideoController extends BaseController
if($info === false){
$this->response('请先设置域名',Code::SYSTEM_ERROR);
}
$this->param['num'] = $this->param['number'];
$rs = $keywordModel->add($this->param);
if($rs === false){
$this->response('添加失败',Code::SYSTEM_ERROR);
... ... @@ -130,6 +130,9 @@ class KeywordVideoController extends BaseController
'id.required' => '主键标识不为空',
]);
$keywordModel = new KeywordVideoTask();
if($this->param['status'] == 0){
$this->param['num'] = $this->param['number'];
}
$rs = $keywordModel->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->response('编辑失败',Code::SYSTEM_ERROR);
... ...