作者 lyh

gx

... ... @@ -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;
... ... @@ -114,11 +114,19 @@ class VideoTask extends Command
'created_at' => date('Y-m-d H:i:s'),
];
KeywordVideoTaskLog::insert($array);
$task_project->num--;
if($sub_task_num == 0){
$task_project->save();
break;
}
$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);
... ...