$this->output['mode'] = $mode;
$time_range = $this->request->getStrParam('time_range');
$keyword_type = $this->request->getStrParam('keyword_type');
$keyword = $this->request->getStrParam('keyword');
$where = [
['name' => 'dv_s_id', 'oper' => '=', 'value' => $this->sid]
];
if(!empty($time_range)){
$add_time_range_arr = explode('~',$time_range);
$where[] = ['name' => 'dv_create_time', 'oper' => '>=', 'value' => strtotime($add_time_range_arr[0])];
$where[] = ['name' => 'dv_create_time', 'oper' => '<', 'value' => strtotime($add_time_range_arr[1]) + 86400];
}
if(!empty($keyword_type)){
$where[] = ['name' => $keyword_type, 'oper' => 'like', 'value' => "%{$keyword}%"];
}
if ($mode > 0) {
$where[] = ['name' => 'dv_video_mode', 'oper' => '=', 'value' => $mode];
}
$sort = ['dv_create_time' => 'DESC'];
//获取视频列表
$Video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_list = $Video_model->getList($where,$this->index,$this->count,$sort);
$temp_video_model = new App_Model_Douyin_MysqlVideoTempVideoStorage($this->sid);
$pailie_video_model = new App_Model_Douyin_MysqlVideoMaterialPailieStorage();
foreach ($video_list as &$item) {
$item['cache_num'] = $temp_video_model->getTempVideoCountByItem($item['dv_id']);
$item['pailie'] = $pailie_video_model->getRowByDvid($item['dv_id']);
$progerss = 40;
if ($item['video_num'] > 0 || $item['image_num'] > 0) {
$progerss += 10;
}
if ($item['audio_num'] > 0 || $item['write_num'] > 0) {
$progerss += 10;
}
if ($item['pailie']['dvmp_is_zuhe']) {
$progerss += 20;
}
if ($item['cache_num'] > 0) {
$progerss += 20;
}
$item['progress'] = $progerss;
}
//计算分页
$active_list_all = $Video_model->getCount($where);
$page_libs = new Libs_Pagination_Paginator($active_list_all,$this->count,'jquery',true);
$pageHtml = $page_libs->render();
$this->output['time_range'] = $time_range;
$this->output['keyword_type'] = $keyword_type;
$this->output['keyword'] = $keyword;
$this->output['video_list'] = $video_list;
$this->output['pageHtml'] = $pageHtml;
$this->output['progress_line'] = [
20 => ['color' => 'red', 'tip' => '创建创意工程已完成'],
40 => ['color' => 'red', 'tip' => '选择混剪模式已完成'],
50 => ['color' => 'orange', 'tip' => '添加音视频素材未完成'],
60 => ['color' => 'orange', 'tip' => '添加音视频素材已完成'],
70 => ['color' => 'blue', 'tip' => '视频混剪组合已完成'],
80 => ['color' => 'blue', 'tip' => '视频混剪组合已完成'],
90 => ['color' => 'green', 'tip' => '视频缓存已完成'],
100 => ['color' => 'green', 'tip' => '工程所有步骤已完成'],
];
$this->output_mode_link();
$this->displaySmarty('dydqtshoppc/video/item-list.tpl');
}
/*
* 剪辑模式链接
*/
private function output_mode_link() {
$video_mixed_mode = plum_parse_config('project_mixed_mode', 'dydqt/project');
array_unshift($video_mixed_mode, [
'title' => '全部',
'mode' => 0,
'desc' => '',
]);
foreach ($video_mixed_mode as &$item) {
$item['link'] = "/dydqtshoppc/video/itemList?mode=".$item['mode'];
}
$this->output['video_mixed_mode'] = $video_mixed_mode;
}
/**
* 视频列表
*/
public function videoListAction() {
//面包屑
$breadcrumbs = [
['title' => '账号运营', 'link' => '#zhyy'],
['title' => '短视频管理', 'link' => '/video/videoList'],
];
$this->buildBreadcrumbs($breadcrumbs);
$add_time_range = $this->request->getStrParam('add_time_range');
$keyword_type = $this->request->getStrParam('keyword_type');
if(!empty($add_time_range)){
$add_time_range_arr = explode('~',$add_time_range);
$where[] = ['name' => 'dv_create_time', 'oper' => '>=', 'value' => strtotime($add_time_range_arr[0])];
$where[] = ['name' => 'dv_create_time', 'oper' => '<', 'value' => strtotime($add_time_range_arr[1]) + 86400];
}
if(!empty($keyword_type)){
$where[] = ['name' => $keyword_type, 'oper' => 'like', 'value' => "%{$keyword}%"];
}
$sort = ['dv_create_time' => 'DESC'];
//获取视频列表
$Video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_list = $Video_model->getList($where,$this->index,$this->count,$sort);
$material_model = new App_Model_Douyin_MysqlVideoMaterialStorage($this->sid);
$temp_video_model = new App_Model_Douyin_MysqlVideoTempVideoStorage($this->sid);
$pailie_video_model = new App_Model_Douyin_MysqlVideoMaterialPailieStorage();
foreach ($video_list as &$item) {
$item['video_num'] = $material_model->getMaterialCountByVideo($item['dv_id'], 1);
$item['audio_num'] = $material_model->getMaterialCountByVideo($item['dv_id'], 2);
$item['image_num'] = $material_model->getMaterialCountByVideo($item['dv_id'], 3);
$item['title_num'] = $material_model->getMaterialCountByVideo($item['dv_id'], 4);
$item['write_num'] = $material_model->getMaterialCountByVideo($item['dv_id'], 5);
$item['cache_num'] = $temp_video_model->getTempVideoCountByItem($item['dv_id']);
$item['pailie'] = $pailie_video_model->getRowByDvid($item['dv_id']);
$progerss = 40;
if ($item['video_num'] > 0 || $item['image_num'] > 0) {
$progerss += 10;
}
if ($item['audio_num'] > 0 || $item['write_num'] > 0) {
$progerss += 10;
}
if ($item['pailie']['dvmp_is_zuhe']) {
$progerss += 20;
}
if ($item['cache_num'] > 0) {
$progerss += 20;
}
$item['progress'] = $progerss;
}
//计算分页
$active_list_all = $Video_model->getCount($where);
$page_libs = new Libs_Pagination_Paginator($active_list_all,$this->count,'jquery',true);
$pageHtml = $page_libs->render();
$this->output['add_time_range'] = $add_time_range;
$this->output['keyword_type'] = $keyword_type;
$this->output['keyword'] = $keyword;
$this->output['video_list'] = $video_list;
$this->output['pageHtml'] = $pageHtml;
$video_mixed_mode = plum_parse_config('project_mixed_mode', 'dydqt/project');
$this->output['video_mixed_mode'] = $video_mixed_mode;
$this->output['progress_line'] = [
20 => ['color' => 'red', 'tip' => '创建创意工程已完成'],
40 => ['color' => 'red', 'tip' => '选择混剪模式已完成'],
50 => ['color' => 'orange', 'tip' => '添加音视频素材未完成'],
60 => ['color' => 'orange', 'tip' => '添加音视频素材已完成'],
70 => ['color' => 'blue', 'tip' => '视频混剪组合已完成'],
80 => ['color' => 'blue', 'tip' => '视频混剪组合已完成'],
90 => ['color' => 'green', 'tip' => '视频缓存已完成'],
100 => ['color' => 'green', 'tip' => '工程所有步骤已完成'],
];
if ($this->front_module == 'eui') {
$this->displaySmarty('dspui/video/videoList.html');
} else {
$this->displaySmarty('dydqtshoppc/video/videoList.html');
}
}
/*
* 创建工程项目
*/
public function createProjectAction() {
$this->useLayout('dydqtshoppc-head.html');
$id = $this->request->getIntParam('id');
//获取视频信息
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $video_model->getRowByIdSid($id, $this->sid);
$use_platform = empty($video_info['dv_use_platform']) ? [] : json_decode($video_info['dv_use_platform'], 1);
if (!empty($video_info)) {
$video_cfg = empty($video_info['dv_platform']) ? null : json_decode($video_info['dv_platform'], 1);
}
//视频混剪模式
$video_mixed_mode = plum_parse_config('project_mixed_mode','dydqt/project');
$this->output['video_info'] = $video_info;
$this->output['use_platform'] = $use_platform;
$this->output['video_cfg'] = empty($video_cfg) ? null : $video_cfg;
$this->output['video_mixed_mode'] = $video_mixed_mode;
$this->output['font_map'] = (new App_Plugin_Ffmpeg_VideoPlugin())->getFontMap();
$color_list = plum_parse_config('color_list', 'config');
$this->output['color_list'] = $color_list;
//火山引擎、腾讯云配音
$huoshan_vcn = plum_parse_config('hsyq_vcn', 'system');