Merge branch 'dev' of ssh://git.bgbg.live:18150/root/SEONexus into dev

# Conflicts:
#	code/app/home/controller/Novel.php
#	code/app/model/NovelModel.php
#	code/extend/template/taglib/Site.php
This commit is contained in:
Default
2025-04-17 17:40:41 +08:00
38 changed files with 2044 additions and 2095 deletions

View File

@@ -141,7 +141,6 @@ class Index extends BaseController
switch ($strTemplatesModel) {
case 'default':
// 默认模板 630zw
// TODO 1.获取所有分类数据,
// 2.然后 每个分类 随机获取 13个小说 ,
// 3.所有分类数据 放到一个数组里, 前端一个循环渲染,排版都是一样的
@@ -153,7 +152,7 @@ class Index extends BaseController
View::assign([
'arrAllCategoryNovel' => $arrAllCategoryNovel,
'arrNewsNovel' => $arrNewsNovel,
'arrCategoryAll' => CategoryModel::$arrCategoryAll,
]);
break;
@@ -164,7 +163,6 @@ class Index extends BaseController
$strKey = sprintf('%s:PC:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 1, 5);
$arrBoyNewsNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 5, 1, NULL, ['n_update_time' => -1]);
// 男生频道,周排行榜 随机10个小说
$strKey = sprintf('%s:PC:INDEX:RANK:%s:SEX:%s', $Request->DomainModel->d_domain, 'weekly', 1);
$arrBoyWeekRankNovel = $NovelModel->getRankNovelOnCache($strKey, 5, 1, 'weekly');
@@ -210,8 +208,8 @@ class Index extends BaseController
$arrRecommendSerializationNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, $intRecommendSerializationNovel, 0, NULL);
// 推荐等级为9的完结的 随机12个小说
$strKey = sprintf('%s:PC:INDEX:TUIJIAN:WANJIE:%s', $Request->DomainModel->d_domain, 12);
$arrRecommendEndNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 12, 0, "已完结");
$strKey = sprintf('%s:PC:INDEX:TUIJIAN:WANJIE:%s', $Request->DomainModel->d_domain, $intRecommendEndNovel);
$arrRecommendEndNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, $intRecommendEndNovel, 0, "已完结");
// 最近更新-随机50
$strKey = sprintf('%s:PC:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 0, 50);

View File

@@ -98,10 +98,11 @@ class Novel extends BaseController
* @param string $strNovelChannel 男生/女生 -拼音
* @param string $strCategory 分类 -拼音
* @param string $strStatus 连载/完结 -拼音
* @param string $strOrder 排序 -拼音
* @param integer $intPage 分页
* @return void
*/
public function getLibrary(Request $Request, $strGender = 'all', $strCategory = 'all', $strStatus = 'all', $strSort = 'all',$intPage = 1)
public function getLibrary(Request $Request, $strGender = 'all', $strCategory = 'all', $strStatus = 'all', $strOrder = 'all', $intPage = 1)
{
$boolIsMobile = $Request->param('boolIsMobile');
$strChannel = $Request->param('strChannel') ?? 'all';
@@ -111,7 +112,6 @@ class Novel extends BaseController
$strNanUrl = str_replace("/", "", $strNanUrlTemp);
$strNvUrl = str_replace("/", "", $strNvUrlTemp);
// 性别
$arrSex = [
'all' => 0,
$strNanUrl => 1,
@@ -160,37 +160,42 @@ class Novel extends BaseController
$intLifeTime = 24 * 3600;
$strTemplatesModel = $Request->TemplatesModel->t_code;
switch ($strTemplatesModel) {
case 'default':
$arrSort = [
['key'=>'all','name'=>'全部'],
['key'=>10,'name'=>'排行'],
['key'=>11,'name'=>'排行'],
['key'=>2,'name'=>'月排行'],
['key'=>3,'name'=>'总排行'],
// ['key'=>4,'name'=>'日推荐'],
// ['key'=>5,'name'=>'周推荐'],
// ['key'=>6,'name'=>'月推荐'],
// ['key' => 'shouchang', 'name' => '收藏'],
['key' => 'tuijian', 'name' => '推荐'],
// ['key' => 'renqi', 'name' => '人气'],
['key' => 'news', 'name' => '最新入库'],
['key' => 'update', 'name' => '最新更新'],
$arrOrder = [
'all' => '全部排序',
'day' => '日排行',
'week' => '排行',
'mon' => '排行',
'click' => '总排行',
'tuijian' => '推荐',
'news' => '最新入库',
'update' => '最新更新',
];
// TODO 当前筛选条件(除了分页)随机6条
$arrTopNovel = [];
if (!$boolIsMobile) {
// TODO 当前筛选条件(除了分页),最新 随机 $intLimit 条
$arrNewsNovel = [];
View::assign([
'arrNewsNovel' => $arrNewsNovel,
]);
} else {
}
$strBaseUrl = app(NovelService::class)->getNovelCategoryUrl('', $strCategory, $strStatus, $strOrder, '{page}');
View::assign([
'arrSort' => $arrSort,
'strSort' => $strSort,
'arrTopNovel' => $arrTopNovel,
'arrOrder' => $arrOrder,
'strOrder' => $strOrder,
]);
break;
case 'kuangYu':
$strBaseUrl = app(NovelService::class)->getNovelCategoryUrl($strGender, $strCategory, $strStatus, "", '{page}');
break;
}
$strKey = sprintf("Novel:Library:%s:%s:%s:%s", $intGender, $strSearchCategory, $strSearchStatus, $intPage);
@@ -205,7 +210,7 @@ class Novel extends BaseController
$strTemplate = 'pc/getLibrary';
}
$strBaseUrl = app(NovelService::class)->getNovelCategoryUrl($strGender, $strCategory, $strStatus, '{page}');
$strBaseUrl = app(NovelService::class)->getNovelCategoryUrl($strGender, $strCategory, $strStatus, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);
// 更新值
@@ -216,7 +221,6 @@ class Novel extends BaseController
'strNovelStatus' => $strSearchStatus,
]);
// $strTitle = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__));
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE');
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS');
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION');
@@ -226,7 +230,7 @@ class Novel extends BaseController
$strDescription = ConverterMovel::convert($strDescriptionTemplate);
View::assign([
'arrNovel' => $arrPage['data'],
'arrNovel' => $arrPage['data'], // TODO default 模板需要加入 $strOrder 筛查数据
'strPageCode' => 'library',
'strGender' => $strGender,
'strCategory' => $strCategory,
@@ -321,88 +325,7 @@ class Novel extends BaseController
}
/**
* 分类
*
* @todo 第一版本不需要
* @param Request $Request
* @param [type] $intCategoryId
* @param integer $intPage
* @return void
*/
// public function getNovelCategory(Request $Request, $intCategoryId = null, $intPage = 1)
// {
// $boolIsMobile = $Request->param('boolIsMobile');
// $strChannel = $Request->param('strChannel'); // 区分男生 / 女生频道
// // 模拟数据-推荐等级为9的连载的男生频道/女生频道, 随机12个小说
// $arrRecommendSerializationNovel = [
// ['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'],
// ['id' => 9, 'name' => '小说3', 'author' => '作者3'],
// ['id' => 10, 'name' => '小说3', 'author' => '作者3'],
// ['id' => 11, 'name' => '小说3', 'author' => '作者3'],
// ['id' => 12, 'name' => '小说3', 'author' => '作者3'],
// ];
// // 模拟数据-推荐等级为9的完结的男生频道/女生频道, 随机8个小说
// $arrRecommendEndNovel = [
// ['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'],
// ];
// // 模拟数据-最近更新-随机50
// $arrNewsUpdateNovel = [
// ['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'],
// ['id' => 9, 'name' => '小说3', 'author' => '作者3'],
// ['id' => 10, 'name' => '小说3', 'author' => '作者3'],
// ['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'],
// ['id' => 9, 'name' => '小说3', 'author' => '作者3'],
// ['id' => 10, 'name' => '小说3', 'author' => '作者3'],
// ];
// View::assign([
// 'arrNewsUpdateNovel' => $arrNewsUpdateNovel,
// 'arrRecommendSerializationNovel' => $arrRecommendSerializationNovel,
// 'arrRecommendEndNovel' => $arrRecommendEndNovel,
// 'arrAdBanner' => [],
// 'strPageCode' => 'category'
// ]);
// if ($boolIsMobile) {
// return View::fetch();
// } else {
// return View::fetch('pc/getNovelCategory');
// }
// }
/**
* 小说详情-kan
* 小说详情-伪造小说
*
* @param Request $Request
* @return void
@@ -471,6 +394,23 @@ class Novel extends BaseController
'$in' => $arrRelateveNId,
]], 10);
$strTemplatesModel = $Request->TemplatesModel->t_code;
switch ($strTemplatesModel) {
case 'default':
// TODO 章节正序 前100 条
$arrChapterAsc = [];
// TODO 和当前小说同分类,完结的小说 随机6个
$arrEndNovel = [];
View::assign([
'arrChapterAsc' => $arrChapterAsc,
'arrEndNovel' => $arrEndNovel,
]);
break;
}
// 更新值
ConverterMovel::setVal([
'intPage' => 1,
@@ -495,6 +435,7 @@ class Novel extends BaseController
unset($arrNovelJs['n_related_novel'], $arrNovelJs['n_forge_novel'], $arrNovelJs['n_description']);
View::assign([
'intPage' => 1,
'arrRelateveNovel' => $arrRelateveNovel,
'arrNovel' => $arrNovel,
'arrNovelJs' => $arrNovelJs,
@@ -503,13 +444,12 @@ class Novel extends BaseController
'arrNovelClicks' => $arrNovelClicks,
'strFocus' => $strFocus,
'intFirstChapterSort' => $intFirstChapterSort,
'strPageCode' => 'boy',
'strPageCode' => 'detail',
'strTitle' => $strTitle,
'strKeywords' => $strKeywords,
'strDescription' => $strDescription,
]);
$strView = $boolIsMobile ? 'getNovelInfo' : 'pc/getNovelInfo';
$this->generateGrm(2, $intNId . '-' . $intForgeId, 50);
return $this->rending($strView);
@@ -575,6 +515,23 @@ class Novel extends BaseController
'$in' => $arrRelateveNId,
]], 10);
$strTemplatesModel = $Request->TemplatesModel->t_code;
switch ($strTemplatesModel) {
case 'default':
// TODO 章节正序 前100 条
$arrChapterAsc = [];
// TODO 和当前小说同分类,完结的小说 随机6个
$arrEndNovel = [];
View::assign([
'arrChapterAsc' => $arrChapterAsc,
'arrEndNovel' => $arrEndNovel,
]);
break;
}
// 更新值
ConverterMovel::setVal([
'intPage' => 1,
@@ -602,7 +559,7 @@ class Novel extends BaseController
'arrNovelClicks' => $arrNovelClicks,
'strFocus' => $strFocus,
'intFirstChapterSort' => $intFirstChapterSort,
'strPageCode' => 'boy',
'strPageCode' => 'detail',
'strTitle' => $strTitle,
'strKeywords' => $strKeywords,
'strDescription' => $strDescription,
@@ -653,6 +610,29 @@ class Novel extends BaseController
$arrChapter['c_content'] = base64_encode($arrChapter['c_content']);
}
$strTemplatesModel = $Request->TemplatesModel->t_code;
switch ($strTemplatesModel) {
case 'default':
// 推荐小说
$arrRelateveNId = array_column($arrNovel['n_related_novel'], 'n_id');
$arrRelateveNovel = $NovelModel->findMany(['n_id' => [
'$in' => $arrRelateveNId,
]], 10);
// TODO 和当前小说同分类,完结的小说 随机6个
$arrEndNovel = [];
View::assign([
'arrRelateveNovel' => $arrRelateveNovel,
'arrEndNovel' => $arrEndNovel,
]);
break;
case 'kuangYu':
}
$arrCategoryAll = CategoryModel::$arrCategoryAll;
// 更新值
@@ -694,11 +674,10 @@ class Novel extends BaseController
]);
$strView = $boolIsMobile ? 'getNovelChapter' : 'pc/getNovelChapter';
$this->generateGrm(2, $intNId . '-' . $arrChapter['c_sort_num'] ?? 0, 20);
$this->generateGrm(2, $intNId . '-' . $arrChapter['c_sort_num'] ?? 0, 100);
return $this->rending($strView);
}
/**
* 章节详情
*
@@ -742,6 +721,28 @@ class Novel extends BaseController
$arrChapter['c_content'] = base64_encode($arrChapter['c_content']);
}
$strTemplatesModel = $Request->TemplatesModel->t_code;
switch ($strTemplatesModel) {
case 'default':
// 推荐小说
$arrRelateveNId = array_column($arrNovel['n_related_novel'], 'n_id');
$arrRelateveNovel = $NovelModel->findMany(['n_id' => [
'$in' => $arrRelateveNId,
]], 10);
// TODO 和当前小说同分类,完结的小说 随机6个
$arrEndNovel = [];
View::assign([
'arrRelateveNovel' => $arrRelateveNovel,
'arrEndNovel' => $arrEndNovel,
]);
break;
case 'kuangYu':
}
$arrCategoryAll = CategoryModel::$arrCategoryAll;
// 更新值
@@ -781,7 +782,7 @@ class Novel extends BaseController
]);
$strView = $boolIsMobile ? '' : 'pc/getNovelChapter';
$this->generateGrm(2, $intNId . '-' . $arrChapter['c_sort_num'] ?? 0, 20);
$this->generateGrm(2, $intNId . '-' . $arrChapter['c_sort_num'] ?? 0, 100);
return $this->rending($strView);
}
@@ -811,7 +812,7 @@ class Novel extends BaseController
$strKey = sprintf('Nid:%s:Chapter-Page:%s:Order:%s', $intNId, $intPage, $strOrder);
$arrFilter = ['n_id' => $intNId, 'c_page' => 0,];
$intLimit = 100;
$intLimit = 10;
$intLifeTime = 12 * 3600;
if ($strOrder == 'zheng') {
@@ -820,6 +821,39 @@ class Novel extends BaseController
$arrSort = ['c_sort_num' => -1];
}
$strTemplatesModel = $Request->TemplatesModel->t_code;
switch ($strTemplatesModel) {
case 'default':
// 第一章
$arrFirstChapter = $ChapterModel->getFirstChapterByNId($intNId, false);
$intFirstChapterSort = null;
if ($arrFirstChapter) {
$intFirstChapterSort = $arrFirstChapter['c_sort_num'];
}
// 推荐小说
$arrRelateveNId = array_column($arrNovel['n_related_novel'], 'n_id');
$arrRelateveNovel = $NovelModel->findMany(['n_id' => [
'$in' => $arrRelateveNId,
]], 10);
// TODO 章节正序 前100 条
$arrChapterAsc = [];
// TODO 和当前小说同分类,完结的小说 随机6个
$arrEndNovel = [];
View::assign([
'arrChapterAsc' => $arrChapterAsc,
'arrEndNovel' => $arrEndNovel,
'intFirstChapterSort' => $intFirstChapterSort,
'arrRelateveNovel' => $arrRelateveNovel,
]);
break;
case 'kuangYu':
}
$arrPage = $ChapterModel->findPaginatedWithCache($arrFilter, $intPage, $intLimit, $arrSort, $strKey, $intLifeTime);
$intButtomNum = 5;
@@ -827,7 +861,7 @@ class Novel extends BaseController
$intButtomNum = 10;
}
$strBaseUrl = sprintf('/pc/xiaoshuo/%s-%s/mulu/%s/{page}', $arrNovel['n_name_pinyin'], $intNId, $strOrder);
$strBaseUrl = app(NovelService::class)->getNovelCatalogUrl($intNId, $arrNovel['n_name_pinyin'], $strOrder, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);
// 更新值
@@ -910,8 +944,7 @@ class Novel extends BaseController
$intButtomNum = 10;
// $strSearchInfoUrlTemp = $Request->DomainModel->getFomartSubject('SEARCH_INFO_URL','',false);
// $strBaseUrl = sprintf('/search.html?keyword=%s&page={page}', $strSearchKeywords);
$strBaseUrl = app(NovelService::class)->getNovelSearchUrl($strSearchKeywords, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);