debug
This commit is contained in:
@@ -346,6 +346,7 @@ class NovelService
|
||||
$arrParams = [
|
||||
'page' => max((int)($arrParams['page'] ?? 1), 1),
|
||||
'limit' => (int)($arrParams['limit'] ?? 10),
|
||||
'button_num' => (int)($arrParams['button_num'] ?? 0),
|
||||
'n_category' => (string)($arrParams['n_category'] ?? ''),
|
||||
'sort_type' => (string)($arrParams['sort_type'] ?? ''),
|
||||
'n_status' => (string)($arrParams['n_status'] ?? ''),
|
||||
@@ -481,6 +482,7 @@ class NovelService
|
||||
|
||||
$arrResult = [
|
||||
'data' => $arrNovel['data'],
|
||||
'pages' => $arrNovel['pages'],
|
||||
'p_data' => $arrPager,
|
||||
];
|
||||
|
||||
@@ -500,13 +502,36 @@ class NovelService
|
||||
$strKey = $arrParams['key'];
|
||||
$intPage = $arrNovel['page'];
|
||||
$intLimit = $arrNovel['limit'];
|
||||
$intButtomNum = 10;
|
||||
$intButtomNum = $arrParams['button_num'];
|
||||
$strBaseUrl = app(NovelService::class)->getNovelSearchUrl($strKey, '{page}');
|
||||
$arrPaginator = CusteomPage02::generate($intPage, $arrNovel['total'], $intLimit, $strBaseUrl, $intButtomNum);
|
||||
|
||||
return $arrPaginator;
|
||||
}
|
||||
|
||||
/**
|
||||
* 书库/分类定制分页
|
||||
*
|
||||
* @param array $arrFilter 查询条件字段
|
||||
* @param array $arrSort 查询排序字段
|
||||
* @param array $arrNovel 查询出来的数据
|
||||
* @return array
|
||||
*/
|
||||
public function generateCategoryPager(array $arrParams, array $arrSort, array $arrNovel): array
|
||||
{
|
||||
$strGender = $arrParams['n_sex'];
|
||||
$strCategory = $arrParams['n_category'];
|
||||
$strStatus = $arrParams['n_status'];
|
||||
$strOrder = $arrParams['sort_type'];
|
||||
$intPage = $arrNovel['page'];
|
||||
$intLimit = $arrNovel['limit'];
|
||||
$intButtomNum = $arrParams['button_num'];
|
||||
$strBaseUrl = app(NovelService::class)->getNovelCategoryUrl($strGender, $strCategory, $strStatus, $strOrder, '{page}');
|
||||
$arrPaginator = CusteomPage02::generate($intPage, $arrNovel['total'], $intLimit, $strBaseUrl, $intButtomNum);
|
||||
|
||||
return $arrPaginator;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据NId获取小说详情
|
||||
@@ -534,7 +559,6 @@ class NovelService
|
||||
$arrNovel['n_category_sex_en'] = $arrNovel['n_category_sex_en'] ?? 'man';
|
||||
|
||||
// 最后章节
|
||||
|
||||
$arrLatestChapter = $this->ChapterModel->getLatestChapterByNId($intNId);
|
||||
|
||||
// 第一章
|
||||
@@ -554,14 +578,7 @@ class NovelService
|
||||
}
|
||||
}
|
||||
|
||||
// 最近五个章节
|
||||
$arrChapter = $this->ChapterModel->findMany([
|
||||
'n_id' => $intNId,
|
||||
'c_page' => 0,
|
||||
], 10, ['c_sort_num' => -1]);
|
||||
|
||||
// 点击数
|
||||
|
||||
$arrNovelClicks = $this->NovelClicksModel->getStats($intNId);
|
||||
|
||||
// 推荐小说
|
||||
@@ -582,7 +599,10 @@ class NovelService
|
||||
'strNovelStatus' => $arrNovel['n_status'],
|
||||
'strNovelDescription' => $arrNovel['n_description'],
|
||||
]);
|
||||
|
||||
$arrNovel['intFirstChapterSort'] = $intFirstChapterSort;
|
||||
$arrNovel['arrNovelClicks'] = $arrNovelClicks;
|
||||
$arrNovel['arrRelateveNovel'] = $arrRelateveNovel;
|
||||
$arrNovel['strFocus'] = $strFocus;
|
||||
|
||||
return $arrNovel;
|
||||
}
|
||||
|
||||
@@ -81,10 +81,30 @@ class SiteContext
|
||||
*/
|
||||
public function initCfg()
|
||||
{
|
||||
// 全局使用的URL模板
|
||||
$strPcUrlTemp = $this->DomainModel->getFomartSubject('PC_URL_PATH','',false);
|
||||
$strNanUrlTemp = $this->DomainModel->getFomartSubject('NAN_SHENG_URL','',false);
|
||||
$strNvUrlTemp = $this->DomainModel->getFomartSubject('NV_SHENG_URL','',false);
|
||||
$strCategoryIndexUrlTemp = $this->DomainModel->getFomartSubject('CATEGORY_INDEX_URL','',false);
|
||||
$strRankUrlTemp = $this->DomainModel->getFomartSubject('RANK_INFO_URL','',false);
|
||||
$strSearchIndexUrlTemp = $this->DomainModel->getFomartSubject('SEARCH_INDEX_URL','',false);
|
||||
$strHistoryUrlTemp = $this->DomainModel->getFomartSubject('HISTORY_INFO_URL','',false);
|
||||
$strBookShelfUrlTemp = $this->DomainModel->getFomartSubject('SHUJIA_INFO_URL','',false);
|
||||
$strUserUrlTemp = $this->DomainModel->getFomartSubject('USER_INFO_URL','',false);
|
||||
|
||||
View::assign("strPcPath", $strPcUrlTemp);
|
||||
View::assign("strNanUrlTemp", $strNanUrlTemp);
|
||||
View::assign("strNvUrlTemp", $strNvUrlTemp);
|
||||
View::assign("strCategoryIndexUrlTemp", $strCategoryIndexUrlTemp);
|
||||
View::assign("strRankUrlTemp", $strRankUrlTemp);
|
||||
View::assign("strSearchIndexUrlTemp", $strSearchIndexUrlTemp);
|
||||
View::assign("strHistoryUrlTemp", $strHistoryUrlTemp);
|
||||
View::assign("strBookShelfUrlTemp", $strBookShelfUrlTemp);
|
||||
View::assign("strUserUrlTemp", $strUserUrlTemp);
|
||||
|
||||
View::assign('Request', $this->Request);
|
||||
View::assign('DomainModel', $this->DomainModel);
|
||||
View::assign('TemplatesModel', $this->TemplatesModel);
|
||||
View::assign('arrCategoryAll', CategoryModel::$arrCategoryAll);
|
||||
|
||||
ConverterMovel::setVal([
|
||||
'strSiteName' => $this->DomainModel->d_name,
|
||||
@@ -133,13 +153,22 @@ class SiteContext
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHomeView(): string
|
||||
public function getHomeView(string $strPlatform): string
|
||||
{
|
||||
if ($this->DomainModel->n_id > 0) {
|
||||
$strView = 'test/test01/faker.html';
|
||||
} else {
|
||||
$strView = 'test/test01/index.html';
|
||||
if ($strPlatform == 'h5') {
|
||||
if ($this->DomainModel->n_id > 0) {
|
||||
$strView = 'novel/getNovelInfo.html';
|
||||
} else {
|
||||
$strView = 'index/index.html';
|
||||
}
|
||||
}else{
|
||||
if ($this->DomainModel->n_id > 0) {
|
||||
$strView = 'pc/getNovelInfo.html';
|
||||
} else {
|
||||
$strView = 'pc/index.html';
|
||||
}
|
||||
}
|
||||
|
||||
return $strView;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user