fix no chapter page error

This commit is contained in:
Default
2025-04-03 17:30:41 +08:00
parent 6e4060ef4f
commit efbbfc3e0f

View File

@@ -553,11 +553,16 @@ class Novel extends BaseController
$arrChapter = $ChapterModel->getChapter($arrFilter); $arrChapter = $ChapterModel->getChapter($arrFilter);
// 上一章节和下一章节 // 上一章节和下一章节
$arrPreChapter = $ChapterModel->getPreChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']); $arrPreChapter = $arrNextChapter = [];
$arrNextChapter = $ChapterModel->getNextChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']);
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; $arrCategoryAll = CategoryModel::$arrCategoryAll;
View::assign([ View::assign([
'arrNovel' => $arrNovel, 'arrNovel' => $arrNovel,
'arrCategoryAll' => $arrCategoryAll, 'arrCategoryAll' => $arrCategoryAll,
@@ -613,7 +618,6 @@ class Novel extends BaseController
$intButtomNum = 5; $intButtomNum = 5;
if ($boolIsMobile == false) { if ($boolIsMobile == false) {
$intButtomNum = 10; $intButtomNum = 10;
} }
$strBaseUrl = sprintf('/pc/xiaoshuo/%s-%s/mulu/%s/{page}', $arrNovel['og_novel_pin_yin'], $intNId, $strOrder); $strBaseUrl = sprintf('/pc/xiaoshuo/%s-%s/mulu/%s/{page}', $arrNovel['og_novel_pin_yin'], $intNId, $strOrder);