public function video_add_check(){
$upload = new \Think\Upload();// 实例化上传类
$upload->maxSize = 10000000000000000000 ;// 设置附件上传大小
$upload->exts = array('jpg', 'gif', 'png', 'jpeg', 'zip', 'ape');// 设置附件上传类型
$upload->rootPath = './Uploads/'; // 设置附件上传根目录
$upload->savePath = ''; // 设置附件上传(子)目录
// 上传文件
$info = $upload->upload();
if(!$info) {// 上传错误提示错误信息
$this->error($upload->getError());
}else{// 上传成功 获取上传文件信息
$date['pic'] = '/Uploads/'.$info['pic']['savepath'].$info['pic']['savename'];
$date['url'] = '/Uploads/'.$info['url']['savepath'].$info['url']['savename'];
}
$date['name'] = I('name');
$date['type'] = I('type');
$date['region'] = I('region');
$date['screens'] = I('screens');
$date['content'] = I('content');
$date['grade'] = I('grade');
$date['status'] = I('status');
$date['star'] = I('star');
$date['add_time'] = date('Y-m-d H:i:s');
$date['add_time2'] = date('Y-m-d');
$date['add_write'] = I('add_write');
$date['click'] = I('click');
$date['tag'] = I('tag');
$date['tcid'] = I('tcid');
$date['era'] = I('era');
$date['cid'] = I('cid');
if(M('video')->add($date)){
$this->success('影视添加成功',U("Admin/Categroy/video_read",array('cid'=>I('cid'),'tcid'=>I('ttcid'))));
}else{
$this->error('添加失败');
}
}