diff --git a/code/app/home/config/router.php b/code/app/home/config/router.php index 50a4169..fcf1b45 100644 --- a/code/app/home/config/router.php +++ b/code/app/home/config/router.php @@ -92,6 +92,18 @@ Route::get('/pc/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::c ->append(['boolIsMobile' => false, 'intUriType' => 1]) ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); +/** + * kan + */ +Route::get('/pc/kan/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) +->append(['boolIsMobile' => false, 'intUriType' => 2]) +->pattern(['n_id' => '\d+','n_forge_id' => '\d+', 'name' => '[\w-]+',]); + +Route::get('/kan/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) +->append(['boolIsMobile' => true, 'intUriType' => 2]) +->pattern(['n_id' => '\d+','n_forge_id' => '\d+', 'name' => '[\w-]+',]); + + /** * 小说详情 * /book/{strPinYin}-{intNId} @@ -150,7 +162,8 @@ Route::get('/novel-:name-:n_id', [Novel::class, 'getNovelInfo']) Route::get('/xiaoshuo-:name-:n_id', [Novel::class, 'getNovelInfo']) ->append(['boolIsMobile' => true, 'intUriType' => 3]) ->pattern(['n_id' => '\d+','name' => '[\w-]+',]); - + + // 搜索小说 Route::get('/search', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); Route::get('/pc/search', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]); diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index a094b74..f934ab6 100644 --- a/code/app/home/controller/Novel.php +++ b/code/app/home/controller/Novel.php @@ -313,6 +313,85 @@ class Novel extends BaseController // } // } + + /** + * 小说详情-kan + * + * @param Request $Request + * @return void + */ + public function getKanNovelInfo(Request $Request) + { + + $intNId = $Request->param('n_id'); + + $boolIsMobile = $Request->param('boolIsMobile'); + + $NovelModel = new NovelModel; + + // 小说详情 + $arrNovel = $NovelModel->getNovelInfo($intNId); + + // 分品拼音 + $arrNovel['category_pinyin'] = CategoryModel::getPinYinByZh($arrNovel['og_novel_category']); + + // 最后章节 + $ChapterModel = new ChapterModel; + $arrLatestChapter = $ChapterModel->getLatestChapter($intNId); + + // 要点 + $strFocus = strip_tags($arrLatestChapter['content']); + $intCount = mb_strlen($strFocus); + if ($intCount > 300) { + $intPos = mt_rand(0, $intCount - 300); + $strFocus = mb_substr($strFocus, $intPos, 300); + } + + // 最近五个章节 + $arrChapter = $ChapterModel->getChapterAll([ + 'n_id' => $intNId, + 'c_page' => 0, + ], 10, ['c_sort_num' => -1]); + + // 点击数 + $NovelClicksModel = new NovelClicksModel; + $arrNovelClicks = $NovelClicksModel->getStats($intNId); + + // 推荐小说 + $arrRelateveNId = array_column($arrNovel['n_related_novel'], 'n_id'); + + $arrRelateveNovel = $NovelModel->getNovelAll([ + '$in' => $arrRelateveNId, + ], 10); + + // echo '
';
+ // var_dump($arrNovel);exit;
+
+ // $strNovel = '斗罗大陆';
+
+ // ConverterMovel::setVal("strNovelName", $strNovel);
+
+ // $strTitle = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__));
+
+ // $strTitle = ConverterMovel::convert($strTitle);
+
+ View::assign([
+ 'arrRelateveNovel' => $arrRelateveNovel,
+ 'arrNovel' => $arrNovel,
+ 'arrChapter' => $arrChapter,
+ 'arrNovelClicks' => $arrNovelClicks,
+ 'strFocus' => $strFocus,
+ 'strPageCode' => 'boy',
+ // 'strTitle' => $strTitle,
+ ]);
+
+ if ($boolIsMobile) {
+ return View::fetch();
+ } else {
+ return View::fetch('pc/getKanNovelInfo');
+ }
+ }
+
/**
* 小说详情
*
@@ -363,7 +442,7 @@ class Novel extends BaseController
'$in' => $arrRelateveNId,
], 10);
// echo '';
- // var_dump($arrLatestChapter);exit;
+ // var_dump($arrNovel);exit;
$strNovel = '斗罗大陆';
@@ -473,8 +552,13 @@ class Novel extends BaseController
$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']);
+ // 缺少数据
+ // 分类:男生和女生所对应的分类,看导航展示
+ // 这个小说的 分类拼音
+ // 这个小说 是属于 女生还是男生
+
// echo '';
- // var_dump($arrChapter);
+ // var_dump($arrNovel);
View::assign([
'arrNovel' => $arrNovel,
@@ -505,20 +589,27 @@ class Novel extends BaseController
public function getNovelChapterAll(Request $Request, $intNovelId = null, $intPage = 1, $strOrder = 'zheng')
{
$boolIsMobile = $Request->param('boolIsMobile');
- // 模拟数据
- $arrNovelChapterAll = [
- ['id' => 1, 'name' => '小说1', 'author' => '作者1'],
- ['id' => 2, 'name' => '小说2', 'author' => '作者2'],
- ['id' => 3, 'name' => '小说3', 'author' => '作者3'],
- ['id' => 4, 'name' => '小说3', 'author' => '作者3'],
- ['id' => 5, 'name' => '小说3', 'author' => '作者3'],
- ['id' => 6, 'name' => '小说3', 'author' => '作者3'],
- ['id' => 7, 'name' => '小说3', 'author' => '作者3'],
- ['id' => 8, 'name' => '小说3', 'author' => '作者3'],
+
+ // 小说详情
+ $NovelModel = new NovelModel;
+ $intNId = $intNovelId;
+ $arrNovel = $NovelModel->getNovelInfo($intNId);
+
+ // 章节目录
+ $arrChapter = [
+ ['c_sort_num' => 1, 'created_at' => '第1章', 'author' => '作者1'],
+ ['c_sort_num' => 1, 'created_at' => '第2章', 'author' => '作者1'],
+ ['c_sort_num' => 1, 'created_at' => '第3章', 'author' => '作者1'],
+ ['c_sort_num' => 1, 'created_at' => '第4章', 'author' => '作者1'],
+ ['c_sort_num' => 1, 'created_at' => '第5章', 'author' => '作者1'],
+ ['c_sort_num' => 1, 'created_at' => '第6章', 'author' => '作者1'],
+
+
];
View::assign([
- 'arrNovelChapterAll' => $arrNovelChapterAll,
+ 'arrNovel' => $arrNovel,
+ 'arrChapter' => $arrChapter,
'intNovelId' => $intNovelId,
'intPage' => $intPage,
'strOrder' => $strOrder,
diff --git a/code/app/home/view/haoZi/Pc/getNovelChapterAll.html b/code/app/home/view/haoZi/Pc/getNovelChapterAll.html
index 544b592..9cc3cf2 100644
--- a/code/app/home/view/haoZi/Pc/getNovelChapterAll.html
+++ b/code/app/home/view/haoZi/Pc/getNovelChapterAll.html
@@ -85,7 +85,8 @@
- 下一页
+ 下一页
+
{foreach $arrNovelChapterAll as $category}
{include file="Pc/Public/chapterTableAll" /}
{/foreach}
diff --git a/code/app/home/view/haoZi/baseH5.html b/code/app/home/view/haoZi/baseH5.html
index 0d2b8a4..7e17dad 100644
--- a/code/app/home/view/haoZi/baseH5.html
+++ b/code/app/home/view/haoZi/baseH5.html
@@ -16,6 +16,7 @@
+
diff --git a/code/app/home/view/haoZi/basePc.html b/code/app/home/view/haoZi/basePc.html
index 4f7d557..1dfbb52 100644
--- a/code/app/home/view/haoZi/basePc.html
+++ b/code/app/home/view/haoZi/basePc.html
@@ -13,6 +13,7 @@
+
+
+
+ 作者:{$arrNovel.og_novel_author}
+ 创建日期:{$arrNovel.og_novel_update_time}
+
+
+ 简介
+
+
+ {$arrNovel.n_page_description}
+ 展开
+
+
+
+
+ 最新要点
+
+
+ {$strFocus}
+ 展开
+
+
+
+
+
+
+
+
+
+ 小说信息
+ 类别:
+
+ {$arrNovel.og_novel_category}
+
+
+
+ 总点击量:{$arrNovelClicks.total}
+ 月点击量:{$arrNovelClicks.monthly}
+ 周点击量:{$arrNovelClicks.weekly}
+ 日点击量:{$arrNovelClicks.daily}
+
+
+
+
+
+
+
+
+
+
+ 最新章节
+
+
+ {volist name="arrChapter" id="Chapter" key="key"}
+
+ {$Chapter.name}
+ {$Chapter.created_at}
+
+
+
+ {/volist}
+
+
+
+ 相邻推荐:
+
+
+ {volist name="arrNovel.n_forge_novel" id="ForgeNovel" key="key"}
+
+ {$ForgeNovel.n_forge_title}
+ {/volist}
+
+
+
+
+
+
+ 精品推荐
+
+ {volist name="arrRelateveNovel" id="Novel" key="key"}
+ -
+
+
+ {$Novel['og_novel_book_name'] ?? ''}
+
+
+
+
+
+
+
+ {$Novel['og_novel_author'] ?? ''}
+ {$Novel['og_novel_category'] ?? ''}
+
+ {$Novel['n_page_description'] ?? ''}
+
+
+
+ {/volist}
+
+
+
+
+
+
+
+{/block}
+
+{block name="customize"}
+
+{/block}
+
+{block name="footer-js"}
+
+
+{/block}
\ No newline at end of file
diff --git a/code/app/home/view/kuangyu/Pc/getNovelChapter.html b/code/app/home/view/kuangyu/Pc/getNovelChapter.html
index 6215869..0def902 100644
--- a/code/app/home/view/kuangyu/Pc/getNovelChapter.html
+++ b/code/app/home/view/kuangyu/Pc/getNovelChapter.html
@@ -8,6 +8,9 @@
01 天龙问世_我真是一条龙-狂雨小说
+ {block name="head-css"}
+
+ {/block}
@@ -26,7 +29,7 @@
最近阅读
@@ -129,9 +131,9 @@
女生
- 耽美百合
+ {$arrNovel.og_novel_category}
- 我真是一条龙
+ {$arrNovel.og_novel_book_name}
@@ -140,19 +142,19 @@
data-info="0|-1|486ef2abee55d|0">
- 01 天龙问世
+ {$arrChapter.name}
- 我真是一条龙
- 兔子很淡定
+ {$arrNovel.og_novel_book_name}
+ {$arrNovel.og_novel_author}
2000字
- 2025-03-20 23:59
+ {$arrChapter.created_at}
- {$arrChapter.content}
+ {$arrChapter.content|raw}
@@ -171,9 +173,15 @@
+ {if $arrChapter.c_sort_num == 1}
上一章
+ {else}
+ 上一章
+ {/if}
|
- 下一章
+ {if $arrNextChapter && $arrNextChapter.c_sort_num}
+ 下一章
+ {/if}
@@ -181,7 +189,7 @@
-
-
+ -->
-
-
-
+ -->
{volist name="arrNovel.n_forge_novel" id="ForgeNovel" key="key"}
-
- 打发十分
+
+ {$ForgeNovel.n_forge_title}
{/volist}
diff --git a/code/app/home/view/kuangyu/Public/novelListS.html b/code/app/home/view/kuangyu/Public/novelListS.html
index f11cfe5..1300a8c 100644
--- a/code/app/home/view/kuangyu/Public/novelListS.html
+++ b/code/app/home/view/kuangyu/Public/novelListS.html
@@ -1,5 +1,5 @@
{$Novel.og_novel_book_name ?? ''}
diff --git a/code/app/home/view/kuangyu/baseH5.html b/code/app/home/view/kuangyu/baseH5.html
index 8a50c9f..86fe2ec 100644
--- a/code/app/home/view/kuangyu/baseH5.html
+++ b/code/app/home/view/kuangyu/baseH5.html
@@ -11,6 +11,7 @@
+
{block name="head-css"}{/block}
{block name="head-js"}{/block}
diff --git a/code/app/home/view/kuangyu/basePc.html b/code/app/home/view/kuangyu/basePc.html
index 3ae8206..863c233 100644
--- a/code/app/home/view/kuangyu/basePc.html
+++ b/code/app/home/view/kuangyu/basePc.html
@@ -9,6 +9,7 @@