diff --git a/code/app/services/VideoService.php b/code/app/services/VideoService.php index 1496ecb..c600441 100644 --- a/code/app/services/VideoService.php +++ b/code/app/services/VideoService.php @@ -683,10 +683,10 @@ class VideoService $arrVideo = $this->VideoModel->getVideoByVId($intVId); // 取前5个元素 - $strTopActor = array_slice($arrVideo['v_actor'], 0, 5); + $strTopActor = (is_array($arrVideo['v_actor'] ?? null)) ? array_slice($arrVideo['v_actor'], 0, 5) : ''; // 取前5个元素 - $strTopDirectors = array_slice($arrVideo['v_director'], 0, 5); + $strTopDirectors = (is_array($arrVideo['v_director'] ?? null)) ? array_slice($arrVideo['v_director'], 0, 5) : ''; // 点击数 $arrVideoClicks = $this->VideoClicksModel->getStats($intVId);