This commit is contained in:
make
2025-04-17 17:28:17 +08:00
parent 3212819051
commit 76010ff43b
29 changed files with 673 additions and 953 deletions

View File

@@ -137,7 +137,6 @@ class Index extends BaseController
switch ($strTemplatesModel) {
case 'default':
// 默认模板 630zw
// TODO 1.获取所有分类数据,
// 2.然后 每个分类 随机获取 13个小说 ,
// 3.所有分类数据 放到一个数组里, 前端一个循环渲染,排版都是一样的
@@ -160,7 +159,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');
@@ -206,8 +204,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

@@ -97,10 +97,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';
@@ -110,7 +111,6 @@ class Novel extends BaseController
$strNanUrl = str_replace("/", "", $strNanUrlTemp);
$strNvUrl = str_replace("/", "", $strNvUrlTemp);
// 性别
$arrSex = [
'all' => 0,
$strNanUrl => 1,
@@ -159,37 +159,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 = NovelModel::getNovelCategoryUrl('', $strCategory, $strStatus, $strOrder, '{page}');
View::assign([
'arrSort' => $arrSort,
'strSort' => $strSort,
'arrTopNovel' => $arrTopNovel,
'arrOrder' => $arrOrder,
'strOrder' => $strOrder,
]);
break;
case 'kuangYu':
$strBaseUrl = NovelModel::getNovelCategoryUrl($strGender, $strCategory, $strStatus, "", '{page}');
break;
}
$strKey = sprintf("Novel:Library:%s:%s:%s:%s", $intGender, $strSearchCategory, $strSearchStatus, $intPage);
@@ -204,7 +209,6 @@ class Novel extends BaseController
$strTemplate = 'pc/getLibrary';
}
$strBaseUrl = NovelModel::getNovelCategoryUrl($strGender, $strCategory, $strStatus, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);
// 更新值
@@ -215,7 +219,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');
@@ -225,7 +228,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,
@@ -320,88 +323,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
@@ -470,6 +392,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,
@@ -574,6 +513,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,
@@ -655,17 +611,19 @@ class Novel extends BaseController
$strTemplatesModel = $Request->TemplatesModel->t_code;
switch ($strTemplatesModel) {
case 'default':
if(!$boolIsMobile){
// 推荐小说
$arrRelateveNId = array_column($arrNovel['n_related_novel'], 'n_id');
$arrRelateveNovel = $NovelModel->findMany(['n_id' => [
'$in' => $arrRelateveNId,
]], 10);
// 推荐小说
$arrRelateveNId = array_column($arrNovel['n_related_novel'], 'n_id');
$arrRelateveNovel = $NovelModel->findMany(['n_id' => [
'$in' => $arrRelateveNId,
]], 10);
View::assign([
'arrRelateveNovel' => $arrRelateveNovel,
]);
}
// TODO 和当前小说同分类,完结的小说 随机6个
$arrEndNovel = [];
View::assign([
'arrRelateveNovel' => $arrRelateveNovel,
'arrEndNovel' => $arrEndNovel,
]);
break;
@@ -764,17 +722,19 @@ class Novel extends BaseController
$strTemplatesModel = $Request->TemplatesModel->t_code;
switch ($strTemplatesModel) {
case 'default':
if(!$boolIsMobile){
// 推荐小说
$arrRelateveNId = array_column($arrNovel['n_related_novel'], 'n_id');
$arrRelateveNovel = $NovelModel->findMany(['n_id' => [
'$in' => $arrRelateveNId,
]], 10);
// 推荐小说
$arrRelateveNId = array_column($arrNovel['n_related_novel'], 'n_id');
$arrRelateveNovel = $NovelModel->findMany(['n_id' => [
'$in' => $arrRelateveNId,
]], 10);
View::assign([
'arrRelateveNovel' => $arrRelateveNovel,
]);
}
// TODO 和当前小说同分类,完结的小说 随机6个
$arrEndNovel = [];
View::assign([
'arrRelateveNovel' => $arrRelateveNovel,
'arrEndNovel' => $arrEndNovel,
]);
break;
@@ -875,7 +835,15 @@ class Novel extends BaseController
'$in' => $arrRelateveNId,
]], 10);
// TODO 章节正序 前100 条
$arrChapterAsc = [];
// TODO 和当前小说同分类,完结的小说 随机6个
$arrEndNovel = [];
View::assign([
'arrChapterAsc' => $arrChapterAsc,
'arrEndNovel' => $arrEndNovel,
'intFirstChapterSort' => $intFirstChapterSort,
'arrRelateveNovel' => $arrRelateveNovel,
]);
@@ -891,7 +859,7 @@ class Novel extends BaseController
$intButtomNum = 10;
}
$strBaseUrl = NovelModel::getNovelCatalogUrl($intNId, $arrNovel['n_name_pinyin'], $strOrder,'{page}');
$strBaseUrl = NovelModel::getNovelCatalogUrl($intNId, $arrNovel['n_name_pinyin'], $strOrder, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);
// 更新值
@@ -974,8 +942,6 @@ class Novel extends BaseController
$intButtomNum = 10;
// $strSearchInfoUrlTemp = $Request->DomainModel->getFomartSubject('SEARCH_INFO_URL','',false);
// $strBaseUrl = sprintf('/search.html?keyword=%s&page={page}', $strSearchKeywords);
$strBaseUrl = NovelModel::getNovelSearchUrl($strSearchKeywords, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);