diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php index f1c49ee..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, @@ -665,6 +655,7 @@ class Novel extends BaseController $arrFilter = ['n_id' => $intNId, 'c_sort_num' => $intChapterSort, 'c_page' => $intChapterPage]; $arrChapter = $ChapterModel->findOne($arrFilter); + $strChapterDescription = ''; // 上一章节和下一章节 $arrPreChapter = $arrNextChapter = []; @@ -672,6 +663,11 @@ class Novel extends BaseController 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; @@ -684,6 +680,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'], ]); diff --git a/code/app/home/view/kuangyu/Novel/getNovelChapter.html b/code/app/home/view/kuangyu/Novel/getNovelChapter.html index 80071e8..3ac8b41 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelChapter.html +++ b/code/app/home/view/kuangyu/Novel/getNovelChapter.html @@ -19,7 +19,7 @@ - + @@ -38,42 +38,38 @@ content="https://{$DomainModel->d_domain}/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrChapter.n_id}/zhang-{$arrChapter.c_sort_num}"> - + - - - - @@ -116,7 +112,6 @@
- {$arrChapter.content|raw}
@@ -142,12 +137,14 @@
-

- - {$arrNovel.og_novel_book_name} + +

+ + {$arrNovel.og_novel_book_name} -

-

{$arrChapter.name}

+ {$arrChapter.name} + +
你刚刚阅读到这里

1/1

diff --git a/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html b/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html index 9c4f413..ca25862 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html +++ b/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html @@ -4,18 +4,18 @@ {block name="description"}{$strDescription??''}{/block} {block name="head"} - + - + content='https://{$DomainModel->d_domain}/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrLatestChapter.c_sort_num ?? 1}' /> + + content="https://{$DomainModel->d_domain}/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$intPage}"> @@ -26,13 +26,14 @@ + {block name="head-js"}{/block} @@ -74,7 +72,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/getNovelInfo.html b/code/app/home/view/kuangyu/Novel/getNovelInfo.html index 77016e4..33a5491 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelInfo.html +++ b/code/app/home/view/kuangyu/Novel/getNovelInfo.html @@ -29,8 +29,8 @@ {/block} @@ -60,12 +61,14 @@ {block name="logo-html"} {/block} {block name="main"}
    + + @@ -95,13 +99,13 @@
    - {$Novel->og_novel_book_name ?? ''}封面 + {$arrNovel['og_novel_book_name'] ?? ''}小说封面 - {$arrNovel.og_novel_author}最新章节 已完结
    -

    {$arrNovel['og_novel_book_name']}

    +

    {$arrNovel['og_novel_book_name']}

    分类:{$arrNovel.og_novel_category} 作者:{$arrNovel.og_novel_author} @@ -163,7 +167,7 @@

    -

    目录

    +

    {$arrNovel.og_novel_book_name}最新章节

      @@ -171,14 +175,14 @@
    • {$arrGRM[$key]|raw} {$Chapter.name} + title="{$arrNovel.og_novel_book_name}-{$Chapter.name}">{$Chapter.name}
    • {/volist}
    更多章节 + class="reading btn-bookshelf">{$arrNovel.og_novel_book_name}更多章节
    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 @@