From 8f39bb20bb424de1972de23373db02eb269ad725 Mon Sep 17 00:00:00 2001 From: make Date: Thu, 10 Apr 2025 15:21:05 +0800 Subject: [PATCH] debug --- code/app/home/controller/Novel.php | 28 +++----- .../home/view/kuangyu/Novel/getNovelInfo.html | 2 +- .../view/kuangyu/Novel/getSearchNovel.html | 36 +++++++--- .../home/view/kuangyu/Pc/getArticleInfo.html | 8 ++- .../home/view/kuangyu/Pc/getArticleList.html | 8 ++- .../home/view/kuangyu/Pc/getKanNovelInfo.html | 8 ++- code/app/home/view/kuangyu/Pc/getLibrary.html | 8 ++- .../home/view/kuangyu/Pc/getNovelChannel.html | 8 ++- .../home/view/kuangyu/Pc/getNovelChapter.html | 58 ++++++++------- .../view/kuangyu/Pc/getNovelChapterAll.html | 63 ++++++++-------- .../home/view/kuangyu/Pc/getNovelInfo.html | 71 +++++++++++-------- .../home/view/kuangyu/Pc/getNovelRank.html | 8 ++- .../home/view/kuangyu/Pc/getSearchNovel.html | 42 ++++++++--- code/app/home/view/kuangyu/Pc/index.html | 10 ++- code/app/home/view/kuangyu/basePc.html | 7 +- code/database/seeders/TemplateSeeder.php | 2 +- .../kuangyu/home/bai_web/css/style.css | 17 +++-- .../kuangyu/home/new_wap/css/style.css | 3 + .../template/kuangyu/reader/web/css/style.css | 4 ++ 19 files changed, 246 insertions(+), 145 deletions(-) diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index 35f5090..8df95ea 100644 --- a/code/app/home/controller/Novel.php +++ b/code/app/home/controller/Novel.php @@ -494,7 +494,7 @@ class Novel extends BaseController $intCount = mb_strlen($strFocus); if ($intCount > 300) { $intPos = mt_rand(0, $intCount - 300); - $strFocus = mb_substr($strFocus, $intPos, 300); + $strFocus = mb_substr($strFocus, 0, 300); } } @@ -573,29 +573,22 @@ class Novel extends BaseController $ChapterModel = ChapterModel::getInstance(); $arrChapter = $ChapterModel->getLatestChapterByNId($intNId); + $strChapterDescription = ''; // 上一章节和下一章节 $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']); + + // 要点-先从章节随机截取,后面如果用上ai,看看使用ai 提炼 精简内容 + $strChapterDescription = strip_tags($arrChapter['content']); + $intCount = mb_strlen($strChapterDescription); + $strChapterDescription = ($intCount > 50) ? mb_substr($strChapterDescription, 0, 50) : $strChapterDescription; } - $arrCategoryAll = CategoryModel::$arrCategoryAll; - // 模拟数据-随机推荐数据10条 - $arrNewsNovel = [ - ['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'], - ]; - // 更新值 ConverterMovel::setVal([ 'intPage' => 1, @@ -604,6 +597,7 @@ class Novel extends BaseController 'strNovelCategoryName' => $arrNovel['og_novel_category'], 'strNovelStatus' => $arrNovel['og_novel_status'], 'strNovelDescription' => $arrNovel['og_description'], + 'strChapterDescription' => $strChapterDescription, 'strNovelChapterName' => $arrChapter['name'] ?? '', 'strNovelChapterSort' => $arrChapter['c_sort_num'] ?? '', ]); @@ -617,10 +611,6 @@ class Novel extends BaseController $strKeywords = ConverterMovel::convert($strKeywordsTemplate); $strDescription = ConverterMovel::convert($strDescriptionTemplate); - View::assign([ - 'arrNewsNovel' => $arrNewsNovel, - 'strPageCode' => 'boy' - ]); View::assign([ 'arrNovel' => $arrNovel, 'arrCategoryAll' => $arrCategoryAll, @@ -682,8 +672,6 @@ class Novel extends BaseController $arrCategoryAll = CategoryModel::$arrCategoryAll; - - // 更新值 ConverterMovel::setVal([ 'intPage' => 1, diff --git a/code/app/home/view/kuangyu/Novel/getNovelInfo.html b/code/app/home/view/kuangyu/Novel/getNovelInfo.html index da01bb9..33a5491 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelInfo.html +++ b/code/app/home/view/kuangyu/Novel/getNovelInfo.html @@ -175,7 +175,7 @@
  • {$arrGRM[$key]|raw} {$Chapter.name} + title="{$arrNovel.og_novel_book_name}-{$Chapter.name}">{$Chapter.name}
  • {/volist} diff --git a/code/app/home/view/kuangyu/Novel/getSearchNovel.html b/code/app/home/view/kuangyu/Novel/getSearchNovel.html index 0296029..ecec6af 100644 --- a/code/app/home/view/kuangyu/Novel/getSearchNovel.html +++ b/code/app/home/view/kuangyu/Novel/getSearchNovel.html @@ -8,15 +8,31 @@ + + + + + + {/block} {block name="head-js"}{/block} @@ -33,7 +49,11 @@