代码:
后台:语言 php
private function output_materail_type($da_id, $type, $video_mode){
$material_model = new App_Model_Douyin_MysqlVideoMaterialStorage($this->sid);
$template_model = new App_Model_Douyin_MysqlVideoTempVideoStorage($this->sid);
$temp_video_count = $template_model->getTempVideoCountByItem($da_id);
$type_list = [
'video' => [
'type' => 1,
'title' => '视频素材('.($material_model->getMaterialCountByVideo($da_id, 1)).')',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=1",
],
'image' => [
'type' => 3,
'title' => '图片素材('.($material_model->getMaterialCountByVideo($da_id, 3)).')',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=3",
],
'audio' => [
'type' => 2,
'title' => '音频素材('.($material_model->getMaterialCountByVideo($da_id, 2)).')',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=2",
],
'title' => [
'type' => 4,
'title' => '标题素材('.($material_model->getMaterialCountByVideo($da_id, 4)).')',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=4",
],
'write' => [
'type' => 5,
'title' => '文案素材('.($material_model->getMaterialCountByVideo($da_id, 5)).')',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=5",
],
public function createTempVideoAction($item_id=0, $num=1){
//获取视频信息
$dv_id = $this->request->getIntParam('dv_id', $item_id);
$create_num = $this->request->getIntParam('create_num', $num);
if ($create_num > 5 || $create_num < 1) {
$this->displayJsonError('单次生成预览不宜超过5个');
}
$video_model= new App_Model_Douyin_MysqlVideoStorage();
$video_info = $video_model->getRowByIdSid($dv_id, $this->sid);
if(empty($video_info)){
$this->displayJsonError('创意工程不存在');
}
//获取排列组合
$pailie_model = new App_Model_Douyin_MysqlVideoMaterialPailieStorage();
$pailie_row = $pailie_model->getRowByDvid($dv_id);
if($pailie_row['dvmp_is_zuhe'] != 1){
$this->displayJsonError('需要生成素材组合');