diff --git a/code/app/home/config/router.php b/code/app/home/config/router.php index 494b872..496d6cd 100644 --- a/code/app/home/config/router.php +++ b/code/app/home/config/router.php @@ -24,13 +24,19 @@ Route::get('/pc/bookshelf', [User::class,'getBookShelf'])->ext('html')->append([ Route::get('paihang/all', [Novel::class,'getNovelRank'])->append(['boolIsMobile' => true]); Route::get("/pc/paihang/all", [Novel::class,'getNovelRank'])->append(['boolIsMobile' => false]); -// 男生/女生 - grok 推荐最优方案 +/** + * 男生/女生 - grok 推荐最优方案 + * + */ Route::get('/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); Route::get('/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); Route::get('/pc/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); Route::get('/pc/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); -// 书库 - grok 推荐最优方案 /shuku/channel-category-status-page +/** + * 书库 - grok 推荐最优方案 + * /shuku/channel-category-status-page + */ Route::get('/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => true]); Route::get('/pc/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => false]); Route::get('/shuku/:strNovelChannel-:strCategory-:strStatus-:intPage', [Novel::class,'getLibrary']) @@ -74,17 +80,13 @@ Route::get('/pc/article/list', [Novel::class,'getArticleList'])->ext('html')->ap Route::get('/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => true]); Route::get('/pc/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => false]); -// 小说详情 -Route::get('/info/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('/pc/info/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => false]); -Route::get('/novel/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('/pc/novel/:intNovelId', [Novel::class, 'getNovelInfo'])->ext('html')->append(['boolIsMobile' => false]); - -// example -// /book/{strPinYin}-{intNId}.html -// /novel/{strPinYin}-{intNId}.html -// /novel-{strPinYin}-{intNId}.html -// /book-{strPinYin}-{intNId}.html +/** + * 小说详情 + * /book/{strPinYin}-{intNId}.html + * /novel/{strPinYin}-{intNId}.html + * /novel-{strPinYin}-{intNId}.html + * /book-{strPinYin}-{intNId}.html + */ Route::get('/pc/book/:name-:n_id', [Novel::class, 'getNovelInfo']) ->append(['boolIsMobile' => false, 'intUriType' => 1]) ->pattern(['n_id' => '\d+','name' => '[\w-]+',]) @@ -110,17 +112,34 @@ Route::get('/pc/books/:name-:n_id/chapter/latest', [Novel::class, 'getNovelNewsC ->append(['boolIsMobile' => false, 'intUriType' => 1]) ->pattern(['n_id' => '\d+','name' => '[\w-]+',]) ->ext('html'); - -// 小说章节 -Route::get('chapter/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/getNovelChapter')->ext('html')->append(['boolIsMobile' => true]); -Route::get('/pc/chapter/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/getNovelChapter')->ext('html')->append(['boolIsMobile' => false]); -Route::get('/pc/books/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/getNovelChapter')->ext('html')->append(['boolIsMobile' => false]); -// 小说目录 -Route::get('/chapters/:intNovelId-[:intPage]-[:strSort]', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('pc/chapters/:intNovelId-[:intPage]-[:strSort]', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => false]); -Route::get('/chapters', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('pc/chapters', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => false]); +/** + * 小说章节 + * /xiaoshuo/小说拼音-小说id/zhang-章节排序/章节分页 + * /xiaoshuo/小说拼音-小说id/di-章节排序-zhang/章节分页 + */ +Route::get('/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) + ->append(['boolIsMobile' => true, 'intUriType' => 1]) + ->pattern(['intNovelId' => '\d+','name' => '[\w-]+','intChapterId' => '\d+','intChapterPage' => '\d+']); + +Route::get('/pc/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) + ->append(['boolIsMobile' => false, 'intUriType' => 1]) + ->pattern(['intNovelId' => '\d+','name' => '[\w-]+','intChapterSort' => '\d+','intChapterPage' => '\d+']); + + +/** + * 小说目录页面 + * /xiaoshuo/[name]-[novel-id]/mulu/order/[page] + */ +Route::get('/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) + ->append(['boolIsMobile' => true, 'intUriType' => 1]) + ->pattern(['intNovelId' => '\d+','name' => '[\w-]+','strOrder' => 'zheng|dao','intPage' => '\d+']); + +Route::get('/pc/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) + ->append(['boolIsMobile' => false, 'intUriType' => 1]) + ->pattern(['intNovelId' => '\d+','name' => '[\w-]+','strOrder' => 'zheng|dao','intPage' => '\d+']); + + // 搜索小说 Route::get('search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index 5816cd5..7367d84 100644 --- a/code/app/home/controller/Novel.php +++ b/code/app/home/controller/Novel.php @@ -387,8 +387,16 @@ class Novel extends BaseController } - // 小说章节 - public function getNovelChapter(Request $Request, $intNovelId = 1, $intChapterId = 1, $intChapterPage = 1) + /** + * 小说章节 + * + * @param Request $Request + * @param integer $intNovelId 小说id + * @param integer $intChapterSort 章节排序 序号 + * @param integer $intChapterPage 每个章节的分页 + * @return void + */ + public function getNovelChapter(Request $Request, $intNovelId = 1, $intChapterSort = 1, $intChapterPage = 0) { $boolIsMobile = $Request->param('boolIsMobile'); @@ -406,7 +414,10 @@ class Novel extends BaseController View::assign([ 'arrNewsNovel' => $arrNewsNovel, - 'strPageCode' => 'boy' + 'strPageCode' => 'boy', + 'intNovelId' => $intNovelId, + 'intChapterSort' => $intChapterSort, + 'intChapterPage' => $intChapterPage, ]); if ($boolIsMobile) { return View::fetch(); @@ -415,8 +426,16 @@ class Novel extends BaseController } } - // 小说章节-所有章节 - public function getNovelChapterAll(Request $Request, $intNovelId = null, $intPage = 1, $strSort = 'asc') + /** + * 小说目录页面 + * + * @param Request $Request + * @param [type] $intNovelId 小说id + * @param integer $intPage 目录分页 + * @param string $strOrder 正序倒叙:zheng/dao + * @return void + */ + public function getNovelChapterAll(Request $Request, $intNovelId = null, $intPage = 1, $strOrder = 'zheng') { $boolIsMobile = $Request->param('boolIsMobile'); // 模拟数据 @@ -433,7 +452,9 @@ class Novel extends BaseController View::assign([ 'arrNovelChapterAll' => $arrNovelChapterAll, - 'strSort' => $strSort, + 'intNovelId' => $intNovelId, + 'intPage' => $intPage, + 'strOrder' => $strOrder, 'strPageCode' => 'chapters', ]); if ($boolIsMobile) { diff --git a/code/app/home/view/kuangyu/Pc/getNovelChapterAll.html b/code/app/home/view/kuangyu/Pc/getNovelChapterAll.html index 12f3b6b..54cbbd0 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelChapterAll.html +++ b/code/app/home/view/kuangyu/Pc/getNovelChapterAll.html @@ -6,7 +6,35 @@ {block name="main"}
+ +
+

落魄千金美食发家日常

作者:鱼昆子

@@ -16,7 +44,7 @@
diff --git a/code/app/home/view/kuangyu/Pc/getNovelInfo.html b/code/app/home/view/kuangyu/Pc/getNovelInfo.html index 6c62f39..d30bad5 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelInfo.html +++ b/code/app/home/view/kuangyu/Pc/getNovelInfo.html @@ -6,6 +6,30 @@ {block name="main"}
+ +
@@ -56,8 +80,8 @@