diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index d57f540..422c0f1 100644 --- a/code/app/home/controller/Novel.php +++ b/code/app/home/controller/Novel.php @@ -553,11 +553,16 @@ class Novel extends BaseController $arrChapter = $ChapterModel->getChapter($arrFilter); // 上一章节和下一章节 - $arrPreChapter = $ChapterModel->getPreChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); - $arrNextChapter = $ChapterModel->getNextChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); - + $arrPreChapter = $arrNextChapter = []; + + if ($arrChapter) { + $arrPreChapter = $ChapterModel->getPreChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); + $arrNextChapter = $ChapterModel->getNextChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); + } + + $arrCategoryAll = CategoryModel::$arrCategoryAll; - + View::assign([ 'arrNovel' => $arrNovel, 'arrCategoryAll' => $arrCategoryAll, @@ -613,7 +618,6 @@ class Novel extends BaseController $intButtomNum = 5; if ($boolIsMobile == false) { $intButtomNum = 10; - } $strBaseUrl = sprintf('/pc/xiaoshuo/%s-%s/mulu/%s/{page}', $arrNovel['og_novel_pin_yin'], $intNId, $strOrder);