This commit is contained in:
Default
2025-04-01 22:10:01 +08:00
parent f26147b8a1
commit a3a2d72734
4 changed files with 104 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ use app\model\NovelModel;
use storage\StorageCore;
use think\facade\View;
use app\Request;
use app\task\crawler\zw630\page\ChapterPage;
use template\page\CusteomPage02;
class Novel extends BaseController
@@ -330,10 +331,22 @@ class Novel extends BaseController
// 小说详情
$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,
@@ -357,7 +370,6 @@ class Novel extends BaseController
ConverterMovel::setVal("strNovelName", $strNovel);
// 模拟数据-随机推荐数据10条
$arrRecommendNovel = [
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
@@ -410,10 +422,22 @@ class Novel extends BaseController
public function getNovelNewsChapter(Request $Request)
{
$boolIsMobile = $Request->param('boolIsMobile');
$intNId = $Request->param('n_id');
// 小说详情
$NovelModel = new NovelModel;
$arrNovel = $NovelModel->getNovelInfo($intNId);
// 最新章节
$ChapterModel = new ChapterModel;
$arrChapter = $ChapterModel->getLatestChapter($intNId);
// 上一章节和下一章节
$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']);
$boolIsMobile = $Request->param('boolIsMobile');
// 模拟数据-随机推荐数据10条
$arrNewsNovel = [