|
@@ -7,6 +7,7 @@ use think\Db;
|
|
|
use think\cache;
|
|
|
use app\utils\RedisKeyEnum;
|
|
|
use app\utils\RedisUtil;
|
|
|
+use Exception;
|
|
|
/**
|
|
|
* 投票
|
|
|
*/
|
|
@@ -85,12 +86,21 @@ class Subject extends Api
|
|
|
}*/
|
|
|
|
|
|
//获取播放地址和秒数
|
|
|
- $videoVod = new \app\common\library\Video();
|
|
|
- $video_PlayInfo = $videoVod->getPlayInfo($info['vodid']);
|
|
|
- $video_PlayInfo = $video_PlayInfo->PlayInfoList->PlayInfo;
|
|
|
+ $info['video_file'] = '';
|
|
|
+ $info['video_seconds'] = 0;
|
|
|
|
|
|
- $info['video_file'] = $video_PlayInfo[0]->PlayURL;
|
|
|
- $info['video_seconds'] = ceil($video_PlayInfo[0]->Duration);
|
|
|
+ if(!empty($info['vodid'])){
|
|
|
+ try{
|
|
|
+ $videoVod = new \app\common\library\Video();
|
|
|
+ $video_PlayInfo = $videoVod->getPlayInfo($info['vodid']);
|
|
|
+ $video_PlayInfo = $video_PlayInfo->PlayInfoList->PlayInfo;
|
|
|
+
|
|
|
+ $info['video_file'] = $video_PlayInfo[0]->PlayURL;
|
|
|
+ $info['video_seconds'] = ceil($video_PlayInfo[0]->Duration);
|
|
|
+ }catch(Exception $e){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//名次
|
|
|
/*$players = Db::name('vote_player')->where(['subject_id'=>$info['subject_id'],'status'=>1])->order('votes desc,id desc')->column('id,votes');
|