From 5df962b3501f638c8985ec23dbde8b0465dba356 Mon Sep 17 00:00:00 2001 From: make Date: Wed, 2 Apr 2025 17:22:15 +0800 Subject: [PATCH] debug --- code/app/home/config/router.php | 15 +- code/app/home/controller/Novel.php | 117 +++++++++-- .../view/haoZi/Pc/getNovelChapterAll.html | 3 +- code/app/home/view/haoZi/baseH5.html | 1 + code/app/home/view/haoZi/basePc.html | 1 + .../home/view/kuangyu/Novel/getNovelInfo.html | 6 +- .../home/view/kuangyu/Pc/getKanNovelInfo.html | 183 ++++++++++++++++++ .../home/view/kuangyu/Pc/getNovelChapter.html | 50 ++--- .../view/kuangyu/Pc/getNovelChapterAll.html | 41 +++- .../home/view/kuangyu/Pc/getNovelInfo.html | 4 +- .../home/view/kuangyu/Public/novelListS.html | 2 +- code/app/home/view/kuangyu/baseH5.html | 1 + code/app/home/view/kuangyu/basePc.html | 1 + code/app/task/crawler/zw630/Scheduler.php | 2 +- .../template/kuangyu/public/css/mulu.css | 88 +++++++++ 15 files changed, 461 insertions(+), 54 deletions(-) create mode 100644 code/app/home/view/kuangyu/Pc/getKanNovelInfo.html create mode 100644 code/public/template/kuangyu/public/css/mulu.css 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} + +
+
+ +
+
+

精品推荐

+ +
+
+
+ + +{/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}

- {$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 @@
- + 目录
@@ -201,17 +209,16 @@
- + 详情
-
- - + --> - - - + -->
{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 ?? ''} {$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 @@ {$strTitle??''} + {block name="head-css"}{/block} {block name="head-js"}{/block} diff --git a/code/app/task/crawler/zw630/Scheduler.php b/code/app/task/crawler/zw630/Scheduler.php index d272ff1..a10c558 100644 --- a/code/app/task/crawler/zw630/Scheduler.php +++ b/code/app/task/crawler/zw630/Scheduler.php @@ -37,7 +37,7 @@ class Scheduler $arrFilter = []; // for ($intNId = 1; $intNId <= 531208; $intNId++) { // for ($intNId = 1; $intNId <= 10000; $intNId++) { - for ($intNId = 1; $intNId <= 200; $intNId++) { + for ($intNId = 1; $intNId <= 20000; $intNId++) { $arrFilter[] = [ 'n_source_id' => $intNId, 'page' => 0, diff --git a/code/public/template/kuangyu/public/css/mulu.css b/code/public/template/kuangyu/public/css/mulu.css new file mode 100644 index 0000000..062151c --- /dev/null +++ b/code/public/template/kuangyu/public/css/mulu.css @@ -0,0 +1,88 @@ +.page_num { + /* 基本容器样式 */ + width: 100%; + max-width: 1200px; /* 最大宽度限制 */ + margin: 20px auto; /* 居中并添加外边距 */ + padding: 0 15px; /* 左右内边距 */ + box-sizing: border-box; + + /* flex布局实现自适应 */ + display: flex; + justify-content: center; + align-items: center; + gap: 15px; /* 元素间距 */ +} + +/* 上一页和下一页链接样式 */ +.z, .y { + text-decoration: none; + padding: 8px 15px; + background-color: #f5f5f5; + color: #333; + border-radius: 4px; + transition: all 0.3s ease; + font-size: 14px; +} + +/* hover效果 */ +.z:hover, .y:hover { + background-color: #e0e0e0; + color: #000; +} + +/* select下拉框样式 */ +.page_num select { + padding: 8px 12px; + border: 1px solid #ddd; + border-radius: 4px; + background-color: white; + font-size: 14px; + min-width: 120px; + cursor: pointer; + appearance: none; /* 移除默认箭头 */ + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: right 8px center; + background-size: 16px; +} + +/* 焦点状态 */ +.page_num select:focus { + outline: none; + border-color: #666; +} + +/* 响应式设计 */ +@media screen and (max-width: 768px) { + .page_num { + gap: 10px; + padding: 0 10px; + } + + .z, .y { + padding: 6px 12px; + font-size: 13px; + } + + .page_num select { + font-size: 13px; + min-width: 100px; + } +} + +@media screen and (max-width: 480px) { + .page_num { + flex-wrap: wrap; /* 小屏幕时允许换行 */ + gap: 8px; + } + + .z, .y { + padding: 5px 10px; + font-size: 12px; + } + + .page_num select { + font-size: 12px; + min-width: 90px; + } +} \ No newline at end of file