|
|
|
@@ -24,101 +24,101 @@ class Index extends BaseController
|
|
|
|
public function index(Request $Request)
|
|
|
|
public function index(Request $Request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
$boolIsMobile = $Request->param('boolIsMobile');
|
|
|
|
// $boolIsMobile = $Request->param('boolIsMobile');
|
|
|
|
$intTTL = 24 * 3600;
|
|
|
|
// $intTTL = 24 * 3600;
|
|
|
|
|
|
|
|
|
|
|
|
$NovelModel = NovelModel::getInstance();
|
|
|
|
// $NovelModel = NovelModel::getInstance();
|
|
|
|
|
|
|
|
|
|
|
|
$strTemplatesModel = $Request->TemplatesModel->t_code;
|
|
|
|
// $strTemplatesModel = $Request->TemplatesModel->t_code;
|
|
|
|
|
|
|
|
|
|
|
|
switch ($strTemplatesModel) {
|
|
|
|
// switch ($strTemplatesModel) {
|
|
|
|
case 'default':
|
|
|
|
// case 'default':
|
|
|
|
// 默认模板 630zw
|
|
|
|
// // 默认模板 630zw
|
|
|
|
// TODO default模板-h5 首页数据: 获取所有分类数据,然后 每个分类 随机获取 10个小说 ,
|
|
|
|
// // TODO default模板-h5 首页数据: 获取所有分类数据,然后 每个分类 随机获取 10个小说 ,
|
|
|
|
// 所有分类数据 放到一个数组里, 前端一个循环渲染,排版都是一样的
|
|
|
|
// // 所有分类数据 放到一个数组里, 前端一个循环渲染,排版都是一样的
|
|
|
|
$arrAllCategoryNovel = [];
|
|
|
|
// $arrAllCategoryNovel = [];
|
|
|
|
|
|
|
|
|
|
|
|
View::assign([
|
|
|
|
// View::assign([
|
|
|
|
'arrAllCategoryNovel' => $arrAllCategoryNovel,
|
|
|
|
// 'arrAllCategoryNovel' => $arrAllCategoryNovel,
|
|
|
|
]);
|
|
|
|
// ]);
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'kuangYu':
|
|
|
|
// case 'kuangYu':
|
|
|
|
$strKey = sprintf('%s:H5:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 0, 8);
|
|
|
|
// $strKey = sprintf('%s:H5:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 0, 8);
|
|
|
|
$arrNewsNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 8, 0, NULL, ['n_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);
|
|
|
|
// $strKey = sprintf('%s:H5:INDEX:RANK:%s:SEX:%s', $Request->DomainModel->d_domain, 'daily', 0);
|
|
|
|
$arrDayRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'daily');
|
|
|
|
// $arrDayRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'daily');
|
|
|
|
|
|
|
|
|
|
|
|
$strKey = sprintf('%s:H5:INDEX:RANK:%s:SEX:%s', $Request->DomainModel->d_domain, 'weekly', 0);
|
|
|
|
// $strKey = sprintf('%s:H5:INDEX:RANK:%s:SEX:%s', $Request->DomainModel->d_domain, 'weekly', 0);
|
|
|
|
$arrWeekRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'weekly');
|
|
|
|
// $arrWeekRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'weekly');
|
|
|
|
|
|
|
|
|
|
|
|
$strKey = sprintf('%s:H5:INDEX:RANK:%s:SEX:%s', $Request->DomainModel->d_domain, 'monthly', 0);
|
|
|
|
// $strKey = sprintf('%s:H5:INDEX:RANK:%s:SEX:%s', $Request->DomainModel->d_domain, 'monthly', 0);
|
|
|
|
$arrMoonRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'monthly');
|
|
|
|
// $arrMoonRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'monthly');
|
|
|
|
|
|
|
|
|
|
|
|
$strStatus = '已完结';
|
|
|
|
// $strStatus = '已完结';
|
|
|
|
$strKey = sprintf('%s:H5:INDEX:RANK:%s:%s', $Request->DomainModel->d_domain, 'total', 'finished');
|
|
|
|
// $strKey = sprintf('%s:H5:INDEX:RANK:%s:%s', $Request->DomainModel->d_domain, 'total', 'finished');
|
|
|
|
$arrEndNovelRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'total', $strStatus);
|
|
|
|
// $arrEndNovelRankNovel = $NovelModel->getRankNovelOnCache($strKey, 10, 0, 'total', $strStatus);
|
|
|
|
|
|
|
|
|
|
|
|
/** @var DomainModel **/
|
|
|
|
// /** @var DomainModel **/
|
|
|
|
$Request->DomainModel;
|
|
|
|
// $Request->DomainModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$strHostNovelDescriptionTemplate = $Request->DomainModel->getFomartSubject('INDEX_POPULAR_NOVELS');
|
|
|
|
// $strHostNovelDescriptionTemplate = $Request->DomainModel->getFomartSubject('INDEX_POPULAR_NOVELS');
|
|
|
|
$strNewsNovelDescriptionTemplate = $Request->DomainModel->getFomartSubject('INDEX_NEWS_NOVELS');
|
|
|
|
// $strNewsNovelDescriptionTemplate = $Request->DomainModel->getFomartSubject('INDEX_NEWS_NOVELS');
|
|
|
|
$strRankNovelDescriptionTemplate = $Request->DomainModel->getFomartSubject('INDEX_RANK_NOVELS');
|
|
|
|
// $strRankNovelDescriptionTemplate = $Request->DomainModel->getFomartSubject('INDEX_RANK_NOVELS');
|
|
|
|
$strHostNovelDescription = ConverterMovel::convert($strHostNovelDescriptionTemplate);
|
|
|
|
// $strHostNovelDescription = ConverterMovel::convert($strHostNovelDescriptionTemplate);
|
|
|
|
$strNewsNovelDescription = ConverterMovel::convert($strNewsNovelDescriptionTemplate);
|
|
|
|
// $strNewsNovelDescription = ConverterMovel::convert($strNewsNovelDescriptionTemplate);
|
|
|
|
$strRankNovelDescription = ConverterMovel::convert($strRankNovelDescriptionTemplate);
|
|
|
|
// $strRankNovelDescription = ConverterMovel::convert($strRankNovelDescriptionTemplate);
|
|
|
|
|
|
|
|
|
|
|
|
View::assign([
|
|
|
|
// View::assign([
|
|
|
|
'arrDayRankNovel' => $arrDayRankNovel,
|
|
|
|
// 'arrDayRankNovel' => $arrDayRankNovel,
|
|
|
|
'arrWeekRankNovel' => $arrWeekRankNovel,
|
|
|
|
// 'arrWeekRankNovel' => $arrWeekRankNovel,
|
|
|
|
'arrMoonRankNovel' => $arrMoonRankNovel,
|
|
|
|
// 'arrMoonRankNovel' => $arrMoonRankNovel,
|
|
|
|
'arrEndNovelRankNovel' => $arrEndNovelRankNovel,
|
|
|
|
// 'arrEndNovelRankNovel' => $arrEndNovelRankNovel,
|
|
|
|
'strHostNovelDescription' => $strHostNovelDescription,
|
|
|
|
// 'strHostNovelDescription' => $strHostNovelDescription,
|
|
|
|
'strNewsNovelDescription' => $strNewsNovelDescription,
|
|
|
|
// 'strNewsNovelDescription' => $strNewsNovelDescription,
|
|
|
|
'strRankNovelDescription' => $strRankNovelDescription,
|
|
|
|
// 'strRankNovelDescription' => $strRankNovelDescription,
|
|
|
|
]);
|
|
|
|
// ]);
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// 推荐等级为9的 随机15个小说
|
|
|
|
// // 推荐等级为9的 随机15个小说
|
|
|
|
$strKey = sprintf('%s:H5:INDEX:TUIJIAN:%s', $Request->DomainModel->d_domain, 8);
|
|
|
|
// $strKey = sprintf('%s:H5:INDEX:TUIJIAN:%s', $Request->DomainModel->d_domain, 8);
|
|
|
|
$arrRecommendNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 8);
|
|
|
|
// $arrRecommendNovel = $NovelModel->getCommonNovelOnCache($strKey, $intTTL, 8);
|
|
|
|
|
|
|
|
|
|
|
|
$strKey = sprintf('%s:H5:INDEX:ZUIJIAN:SEX:%s:%s', $Request->DomainModel->d_domain, 0, 8);
|
|
|
|
// $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, ['og_novel_update_time' => -1]);
|
|
|
|
|
|
|
|
|
|
|
|
// Title 模板
|
|
|
|
// // Title 模板
|
|
|
|
ConverterMovel::setVal([
|
|
|
|
// ConverterMovel::setVal([
|
|
|
|
'strIndexTitle' => $this->request->DomainModel->d_index_title,
|
|
|
|
// 'strIndexTitle' => $this->request->DomainModel->d_index_title,
|
|
|
|
'strIndexKeywords' => $this->request->DomainModel->d_index_keywords,
|
|
|
|
// 'strIndexKeywords' => $this->request->DomainModel->d_index_keywords,
|
|
|
|
'strIndexDescription' => $this->request->DomainModel->d_index_description,
|
|
|
|
// 'strIndexDescription' => $this->request->DomainModel->d_index_description,
|
|
|
|
]);
|
|
|
|
// ]);
|
|
|
|
$strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE');
|
|
|
|
// $strTitleTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@TITLE');
|
|
|
|
$strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS');
|
|
|
|
// $strKeywordsTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@KEYWORDS');
|
|
|
|
$strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION');
|
|
|
|
// $strDescriptionTemplate = $Request->DomainModel->getFomartSubject(getFomartSubjectKey(__METHOD__) . '@DESCRIPTION');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$strTitle = ConverterMovel::convert($strTitleTemplate);
|
|
|
|
// $strTitle = ConverterMovel::convert($strTitleTemplate);
|
|
|
|
$strKeywords = ConverterMovel::convert($strKeywordsTemplate);
|
|
|
|
// $strKeywords = ConverterMovel::convert($strKeywordsTemplate);
|
|
|
|
$strDescription = ConverterMovel::convert($strDescriptionTemplate);
|
|
|
|
// $strDescription = ConverterMovel::convert($strDescriptionTemplate);
|
|
|
|
|
|
|
|
|
|
|
|
View::assign([
|
|
|
|
// View::assign([
|
|
|
|
'arrRecommendNovel' => $arrRecommendNovel,
|
|
|
|
// 'arrRecommendNovel' => $arrRecommendNovel,
|
|
|
|
'arrNewsNovel' => $arrNewsNovel,
|
|
|
|
// 'arrNewsNovel' => $arrNewsNovel,
|
|
|
|
'strPageCode' => 'home',
|
|
|
|
// 'strPageCode' => 'home',
|
|
|
|
'strTitle' => $strTitle,
|
|
|
|
// 'strTitle' => $strTitle,
|
|
|
|
'strKeywords' => $strKeywords,
|
|
|
|
// 'strKeywords' => $strKeywords,
|
|
|
|
'strDescription' => $strDescription,
|
|
|
|
// 'strDescription' => $strDescription,
|
|
|
|
|
|
|
|
|
|
|
|
]);
|
|
|
|
// ]);
|
|
|
|
|
|
|
|
|
|
|
|
$strView = $boolIsMobile ? '' : 'pc/index';
|
|
|
|
// $strView = $boolIsMobile ? '' : 'pc/index';
|
|
|
|
|
|
|
|
|
|
|
|
$this->generateGrm(1, 0, 60);
|
|
|
|
// $this->generateGrm(1, 0, 60);
|
|
|
|
return $this->rending($strView);
|
|
|
|
// return $this->rending($strView);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|