This commit is contained in:
Default
2025-04-15 21:16:14 +08:00
parent 694d5fd14c
commit d19ea97481
47 changed files with 907 additions and 769 deletions

View File

@@ -42,7 +42,7 @@ class Index extends BaseController
break;
case 'kuangYu':
$strKey = sprintf('%s:H5:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 0, 8);
$arrNewsNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 8, 0, NULL, ['og_novel_update_time' => -1]);
$arrNewsNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 8, 0, NULL, ['n_update_time' => -1]);
$strKey = sprintf('%s:H5:INDEX:RANK:%s:SEX:%s', $Request->DomainModel->d_domain, 'daily', 0);
$arrDayRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'daily');
@@ -141,7 +141,7 @@ class Index extends BaseController
// 男生频道,最新的 随机5个小说
$strKey = sprintf('%s:PC:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 1, 5);
$arrBoyNewsNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 5, 1, NULL, ['og_novel_update_time' => -1]);
$arrBoyNewsNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 5, 1, NULL, ['n_update_time' => -1]);
// 男生频道,周排行榜 随机10个小说
@@ -158,7 +158,7 @@ class Index extends BaseController
// 女生频道,最新的 随机5个小说
$strKey = sprintf('%s:PC:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 2, 5);
$arrGirlNewsNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 5, 2, NULL, ['og_novel_update_time' => -1]);
$arrGirlNewsNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 5, 2, NULL, ['n_update_time' => -1]);
// 女生频道,周排行榜 随机10个小说
$strKey = sprintf('%s:PC:INDEX:RANK:%s:SEX:%s', $Request->DomainModel->d_domain, 'weekly', 2);
@@ -174,7 +174,7 @@ class Index extends BaseController
// 最近更新-随机50
$strKey = sprintf('%s:PC:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 0, 50);
$arrNewsUpdateNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 50, 0, NULL, ['og_novel_update_time' => -1]);
$arrNewsUpdateNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 50, 0, NULL, ['n_update_time' => -1]);
// Title 模板
ConverterMovel::setVal([

View File

@@ -248,11 +248,11 @@ class Novel extends BaseController
// 模拟数据-最近更新-随机50
$strKey = sprintf('%s:PC:Novel:Channel:Latest:%s', $Request->DomainModel->d_domain, $intType);
$intCount = 20;
$arrNewsUpdateNovel = $NovelModel->getCommonNovelOnCache($strKey, $intLifeTime, $intCount, $intType, NULL, ['og_novel_update_time' => -1]);
$arrNewsUpdateNovel = $NovelModel->getCommonNovelOnCache($strKey, $intLifeTime, $intCount, $intType, NULL, ['n_update_time' => -1]);
// echo "<pre>";
// var_dump($arrNewsUpdateNovel);exit;
// TODO og_description 改成 og_description
// TODO n_description 改成 n_description
// 更新值
ConverterMovel::setVal([
'intPage' => 1,
@@ -388,14 +388,14 @@ class Novel extends BaseController
foreach ($arrNovel['n_forge_novel'] as $arrForgeNovel) {
if ($arrForgeNovel['n_forge_id'] == $intForgeId) {
$arrNovel['og_novel_book_name'] = $arrForgeNovel['n_forge_title'];
$arrNovel['n_name'] = $arrForgeNovel['n_forge_title'];
break;
}
}
// 分类拼音
$arrNovel['category_pinyin'] = CategoryModel::getPinYinByZh($arrNovel['og_novel_category']);
$arrNovel['category_sex'] = $arrNovel['category_sex'] ?? 'man';
$arrNovel['n_category_pinyin'] = CategoryModel::getPinYin($arrNovel['n_category']);
$arrNovel['n_category_sex_en'] = $arrNovel['n_category_sex_en'] ?? 'man';
// 最后章节
$ChapterModel = ChapterModel::getInstance();
@@ -411,7 +411,7 @@ class Novel extends BaseController
$strFocus = '';
// 要点
if ($arrLatestChapter) {
$strFocus = strip_tags($arrLatestChapter['content']);
$strFocus = strip_tags($arrLatestChapter['c_content']);
$intCount = mb_strlen($strFocus);
if ($intCount > 300) {
$intPos = mt_rand(0, $intCount - 300);
@@ -439,12 +439,12 @@ class Novel extends BaseController
// 更新值
ConverterMovel::setVal([
'intPage' => 1,
'strNovelName' => $arrNovel['og_novel_book_name'],
'strNovelAuthor' => $arrNovel['og_novel_author'],
'strNovelCategoryName' => $arrNovel['og_novel_category'],
'strNovelSex' => $arrNovel['category_sex'] == 'man' ? '男生' : '女生',
'strNovelStatus' => $arrNovel['og_novel_status'],
'strNovelDescription' => $arrNovel['og_description'],
'strNovelName' => $arrNovel['n_name'],
'strNovelAuthor' => $arrNovel['n_author'],
'strNovelCategoryName' => $arrNovel['n_category'],
'strNovelSex' => $arrNovel['n_category_sex_en'] == 'man' ? '男生' : '女生',
'strNovelStatus' => $arrNovel['n_status'],
'strNovelDescription' => $arrNovel['n_description'],
]);
$strTitleTemplate = $Request->DomainModel->getFomartSubject('NOVEL@GETNOVELINFO@TITLE',$intForgeId);
@@ -457,7 +457,7 @@ class Novel extends BaseController
// js使用到
$arrNovelJs = $arrNovel;
unset($arrNovelJs['n_related_novel'], $arrNovelJs['n_forge_novel'], $arrNovelJs['og_description']);
unset($arrNovelJs['n_related_novel'], $arrNovelJs['n_forge_novel'], $arrNovelJs['n_description']);
View::assign([
'arrRelateveNovel' => $arrRelateveNovel,
@@ -498,8 +498,8 @@ class Novel extends BaseController
$arrNovel = $NovelModel->getNovelByNId($intNId);
// 分类拼音
$arrNovel['category_pinyin'] = CategoryModel::getPinYinByZh($arrNovel['og_novel_category']);
$arrNovel['category_sex'] = $arrNovel['category_sex'] ?? 'man';
$arrNovel['n_category_pinyin'] = CategoryModel::getPinYin($arrNovel['n_category']);
$arrNovel['n_category_sex_en'] = $arrNovel['n_category_sex_en'] ?? 'man';
// 最后章节
$ChapterModel = ChapterModel::getInstance();
@@ -515,7 +515,7 @@ class Novel extends BaseController
$strFocus = '';
// 要点
if ($arrLatestChapter) {
$strFocus = strip_tags($arrLatestChapter['content']);
$strFocus = strip_tags($arrLatestChapter['c_content']);
$intCount = mb_strlen($strFocus);
if ($intCount > 300) {
$intPos = mt_rand(0, $intCount - 300);
@@ -543,12 +543,12 @@ class Novel extends BaseController
// 更新值
ConverterMovel::setVal([
'intPage' => 1,
'strNovelName' => $arrNovel['og_novel_book_name'],
'strNovelAuthor' => $arrNovel['og_novel_author'],
'strNovelCategoryName' => $arrNovel['og_novel_category'],
'strNovelSex' => $arrNovel['category_sex'] == 'man' ? '男生' : '女生',
'strNovelStatus' => $arrNovel['og_novel_status'],
'strNovelDescription' => $arrNovel['og_description'],
'strNovelName' => $arrNovel['n_name'],
'strNovelAuthor' => $arrNovel['n_author'],
'strNovelCategoryName' => $arrNovel['n_category'],
'strNovelSex' => $arrNovel['n_category_sex_en'] == 'man' ? '男生' : '女生',
'strNovelStatus' => $arrNovel['n_status'],
'strNovelDescription' => $arrNovel['n_description'],
]);
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE',$intNId);
@@ -595,8 +595,8 @@ class Novel extends BaseController
$NovelModel = NovelModel::getInstance();
$arrNovel = $NovelModel->getNovelByNId($intNId);
$arrNovel['category_pinyin'] = $arrNovel['category_pinyin'] ?? 'all';
$arrNovel['category_sex'] = $arrNovel['category_sex'] ?? 'man';
$arrNovel['n_category_pinyin'] = $arrNovel['n_category_pinyin'] ?? 'all';
$arrNovel['n_category_sex_en'] = $arrNovel['n_category_sex_en'] ?? 'man';
// 最新章节
$ChapterModel = ChapterModel::getInstance();
@@ -611,9 +611,11 @@ class Novel extends BaseController
$arrNextChapter = $ChapterModel->getNextChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']);
// 要点-先从章节随机截取后面如果用上ai看看使用ai 提炼 精简内容
$strChapterDescription = strip_tags($arrChapter['content']);
$strChapterDescription = strip_tags($arrChapter['c_content']);
$intCount = mb_strlen($strChapterDescription);
$strChapterDescription = ($intCount > 50) ? mb_substr($strChapterDescription, 0, 50) : $strChapterDescription;
$arrChapter['c_content'] = base64_encode($arrChapter['c_content']);
}
$arrCategoryAll = CategoryModel::$arrCategoryAll;
@@ -621,13 +623,13 @@ class Novel extends BaseController
// 更新值
ConverterMovel::setVal([
'intPage' => 1,
'strNovelName' => $arrNovel['og_novel_book_name'],
'strNovelAuthor' => $arrNovel['og_novel_author'],
'strNovelCategoryName' => $arrNovel['og_novel_category'],
'strNovelStatus' => $arrNovel['og_novel_status'],
'strNovelDescription' => $arrNovel['og_description'],
'strNovelName' => $arrNovel['n_name'],
'strNovelAuthor' => $arrNovel['n_author'],
'strNovelCategoryName' => $arrNovel['n_category'],
'strNovelStatus' => $arrNovel['n_status'],
'strNovelDescription' => $arrNovel['n_description'],
'strChapterDescription' => $strChapterDescription,
'strNovelChapterName' => $arrChapter['name'] ?? '',
'strNovelChapterName' => $arrChapter['c_name'] ?? '',
'strNovelChapterSort' => $arrChapter['c_sort_num'] ?? '',
]);
@@ -640,6 +642,7 @@ class Novel extends BaseController
$strKeywords = ConverterMovel::convert($strKeywordsTemplate);
$strDescription = ConverterMovel::convert($strDescriptionTemplate);
View::assign([
'arrNovel' => $arrNovel,
'arrCategoryAll' => $arrCategoryAll,
@@ -679,8 +682,8 @@ class Novel extends BaseController
$intNId = $intNovelId;
$arrNovel = $NovelModel->getNovelByNId($intNId);
$arrNovel['category_pinyin'] = $arrNovel['category_pinyin'] ?? 'all';
$arrNovel['category_sex'] = $arrNovel['category_sex'] ?? 'man';
$arrNovel['n_category_pinyin'] = $arrNovel['n_category_pinyin'] ?? 'all';
$arrNovel['n_category_sex_en'] = $arrNovel['n_category_sex_en'] ?? 'man';
// 章节
$ChapterModel = ChapterModel::getInstance();
@@ -697,11 +700,11 @@ class Novel extends BaseController
$arrNextChapter = $ChapterModel->getNextChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']);
// 要点-先从章节随机截取后面如果用上ai看看使用ai 提炼 精简内容
$strChapterDescription = strip_tags($arrChapter['content']);
$strChapterDescription = strip_tags($arrChapter['c_content']);
$intCount = mb_strlen($strChapterDescription);
$strChapterDescription = ($intCount > 50) ? mb_substr($strChapterDescription, 0, 50) : $strChapterDescription;
$arrChapter['content'] = base64_encode($arrChapter['content']);
$arrChapter['c_content'] = base64_encode($arrChapter['c_content']);
}
$arrCategoryAll = CategoryModel::$arrCategoryAll;
@@ -709,13 +712,13 @@ class Novel extends BaseController
// 更新值
ConverterMovel::setVal([
'intPage' => 1,
'strNovelName' => $arrNovel['og_novel_book_name'],
'strNovelAuthor' => $arrNovel['og_novel_author'],
'strNovelCategoryName' => $arrNovel['og_novel_category'],
'strNovelStatus' => $arrNovel['og_novel_status'],
'strNovelDescription' => $arrNovel['og_description'],
'strNovelName' => $arrNovel['n_name'],
'strNovelAuthor' => $arrNovel['n_author'],
'strNovelCategoryName' => $arrNovel['n_category'],
'strNovelStatus' => $arrNovel['n_status'],
'strNovelDescription' => $arrNovel['n_description'],
'strChapterDescription' => $strChapterDescription,
'strNovelChapterName' => $arrChapter['name'],
'strNovelChapterName' => $arrChapter['c_name'],
'strNovelChapterSort' => $arrChapter['c_sort_num'],
]);
@@ -765,8 +768,8 @@ class Novel extends BaseController
$intNId = $intNovelId;
$arrNovel = $NovelModel->getNovelByNId($intNId);
$arrNovel['category_pinyin'] = $arrNovel['category_pinyin'] ?? 'all';
$arrNovel['category_sex'] = $arrNovel['category_sex'] ?? 'man';
$arrNovel['n_category_pinyin'] = $arrNovel['n_category_pinyin'] ?? 'all';
$arrNovel['n_category_sex_en'] = $arrNovel['n_category_sex_en'] ?? 'man';
$ChapterModel = ChapterModel::getInstance();
@@ -789,18 +792,18 @@ class Novel extends BaseController
$intButtomNum = 10;
}
$strBaseUrl = sprintf('/pc/xiaoshuo/%s-%s/mulu/%s/{page}', $arrNovel['og_novel_pin_yin'], $intNId, $strOrder);
$strBaseUrl = sprintf('/pc/xiaoshuo/%s-%s/mulu/%s/{page}', $arrNovel['n_name_pinyin'], $intNId, $strOrder);
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);
// 更新值
ConverterMovel::setVal([
'intPage' => $intPage,
'strNovelSex' => $arrNovel['category_sex'] == 'man' ? '男生' : '女生',
'strNovelName' => $arrNovel['og_novel_book_name'],
'strNovelAuthor' => $arrNovel['og_novel_author'],
'strNovelCategoryName' => $arrNovel['og_novel_category'],
'strNovelStatus' => $arrNovel['og_novel_status'],
'strNovelDescription' => $arrNovel['og_description'],
'strNovelSex' => $arrNovel['n_category_sex_en'] == 'man' ? '男生' : '女生',
'strNovelName' => $arrNovel['n_name'],
'strNovelAuthor' => $arrNovel['n_author'],
'strNovelCategoryName' => $arrNovel['n_category'],
'strNovelStatus' => $arrNovel['n_status'],
'strNovelDescription' => $arrNovel['n_description'],
]);
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE',$intNId);
@@ -861,10 +864,10 @@ class Novel extends BaseController
$arrFilter = [
'$or' => [
['og_novel_book_name' => ['$regex' => $strSearchKeywords, '$options' => 'i']],
['og_novel_author' => ['$regex' => $strSearchKeywords, '$options' => 'i']],
['og_novel_category' => ['$regex' => $strSearchKeywords, '$options' => 'i']],
['og_description' => ['$regex' => $strSearchKeywords, '$options' => 'i']],
['n_name' => ['$regex' => $strSearchKeywords, '$options' => 'i']],
['n_author' => ['$regex' => $strSearchKeywords, '$options' => 'i']],
['n_category' => ['$regex' => $strSearchKeywords, '$options' => 'i']],
['n_description' => ['$regex' => $strSearchKeywords, '$options' => 'i']],
]
];