debug
This commit is contained in:
@@ -74,8 +74,10 @@ class Index extends BaseController
|
||||
|
||||
// 推荐等级为9的连载的 随机15个小说
|
||||
$arrRecommendSerializationNovel = $NovelModel->getHighLevelNovelOnCache($Request->DomainModel->d_domain, 13);
|
||||
# TODO 没有数据展示
|
||||
// echo "<pre>";
|
||||
// var_dump($arrRecommendSerializationNovel);
|
||||
// exit;
|
||||
|
||||
// 推荐等级为9的完结的 随机12个小说
|
||||
$arrRecommendEndNovel = $NovelModel->getFinishedNovelOnCache($Request->DomainModel->d_domain, 12);
|
||||
|
||||
@@ -159,8 +159,12 @@ class Novel extends BaseController
|
||||
'strStatus' => $strStatus,
|
||||
'intPage' => $intPage,
|
||||
'intTotalPage' => $arrPage['pages'],
|
||||
'arrCategory' => array_combine(array_values(CategoryModel::$arrCategoryPinYin), array_values(CategoryModel::$arrCategory)),
|
||||
// TODO 返回所有分类了,应该只返回对应 性别的分类,暂时按下面的返回了,你看看要咋处理
|
||||
// 'arrCategory' => array_combine(array_values(CategoryModel::$arrCategoryPinYin), array_values(CategoryModel::$arrCategory)),
|
||||
'arrCategoryAll' => CategoryModel::$arrCategoryAll,
|
||||
|
||||
'arrPaginator' => $arrPaginator,
|
||||
|
||||
]);
|
||||
|
||||
return View::fetch($strTemplate);
|
||||
@@ -323,7 +327,7 @@ class Novel extends BaseController
|
||||
*/
|
||||
public function getKanNovelInfo(Request $Request)
|
||||
{
|
||||
|
||||
// TODO 这个页面数据没有处理
|
||||
$intNId = $Request->param('n_id');
|
||||
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
@@ -336,16 +340,20 @@ class Novel extends BaseController
|
||||
// 分品拼音
|
||||
$arrNovel['category_pinyin'] = CategoryModel::getPinYinByZh($arrNovel['og_novel_category']);
|
||||
|
||||
|
||||
// 最后章节
|
||||
$ChapterModel = new ChapterModel;
|
||||
$arrLatestChapter = $ChapterModel->getLatestChapter($intNId);
|
||||
|
||||
$strFocus = '';
|
||||
// 要点
|
||||
$strFocus = strip_tags($arrLatestChapter['content']);
|
||||
$intCount = mb_strlen($strFocus);
|
||||
if ($intCount > 300) {
|
||||
$intPos = mt_rand(0, $intCount - 300);
|
||||
$strFocus = mb_substr($strFocus, $intPos, 300);
|
||||
if ($arrLatestChapter) {
|
||||
$strFocus = strip_tags($arrLatestChapter['content']);
|
||||
$intCount = mb_strlen($strFocus);
|
||||
if ($intCount > 300) {
|
||||
$intPos = mt_rand(0, $intCount - 300);
|
||||
$strFocus = mb_substr($strFocus, $intPos, 300);
|
||||
}
|
||||
}
|
||||
|
||||
// 最近五个章节
|
||||
@@ -364,7 +372,6 @@ class Novel extends BaseController
|
||||
$arrRelateveNovel = $NovelModel->getNovel(['n_id' => [
|
||||
'$in' => $arrRelateveNId,
|
||||
]], 10);
|
||||
|
||||
// echo '<pre>';
|
||||
// var_dump($arrNovel);exit;
|
||||
|
||||
@@ -620,7 +627,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 = 10;
|
||||
$intLimit = 100;
|
||||
$intLifeTime = 12 * 3600;
|
||||
|
||||
if ($strOrder == 'zheng') {
|
||||
@@ -638,29 +645,16 @@ class Novel extends BaseController
|
||||
|
||||
$strBaseUrl = sprintf('/pc/xiaoshuo/%s-%s/mulu/%s/{page}', $arrNovel['og_novel_pin_yin'], $intNId, $strOrder);
|
||||
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);
|
||||
// echo '<pre>';
|
||||
|
||||
// print_r($arrPage);
|
||||
// exit;
|
||||
// 章节目录
|
||||
$arrChapter = [
|
||||
['c_sort_num' => 1, 'name' => '第1章', 'created_at' => '作者1'],
|
||||
['c_sort_num' => 1, 'name' => '第2章', 'created_at' => '作者1'],
|
||||
['c_sort_num' => 1, 'name' => '第3章', 'created_at' => '作者1'],
|
||||
['c_sort_num' => 1, 'name' => '第4章', 'created_at' => '作者1'],
|
||||
['c_sort_num' => 1, 'name' => '第5章', 'created_at' => '作者1'],
|
||||
['c_sort_num' => 1, 'name' => '第6章', 'created_at' => '作者1'],
|
||||
|
||||
];
|
||||
|
||||
|
||||
View::assign([
|
||||
'arrNovel' => $arrNovel,
|
||||
'arrPage' => $arrPage,
|
||||
'arrChapter' => $arrChapter,
|
||||
'arrPaginator' => $arrPaginator,
|
||||
'intNovelId' => $intNovelId,
|
||||
'intPage' => $intPage,
|
||||
'strOrder' => $strOrder,
|
||||
'strPageCode' => 'chapters',
|
||||
'intLimit' => $intLimit,
|
||||
]);
|
||||
if ($boolIsMobile) {
|
||||
return View::fetch();
|
||||
@@ -679,7 +673,7 @@ class Novel extends BaseController
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
$strKeywords = (string)$Request->get('q');
|
||||
$strKeywords = (string)$Request->get('keyword');
|
||||
$intPage = (int)$Request->get('page', 1);
|
||||
$intLimit = 20;
|
||||
|
||||
@@ -705,27 +699,18 @@ class Novel extends BaseController
|
||||
|
||||
$intButtomNum = 10;
|
||||
|
||||
$strBaseUrl = sprintf('/pc/search.html?q=%s&page={page}', $strKeywords);
|
||||
$strBaseUrl = sprintf('/search.html?keyword=%s&page={page}', $strKeywords);
|
||||
$arrPaginator = CusteomPage02::generate($intPage, $arrPage['total'], $intLimit, $strBaseUrl, $intButtomNum);
|
||||
|
||||
// 模拟数据
|
||||
$arrSearchNovel = [
|
||||
['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'],
|
||||
];
|
||||
|
||||
View::assign([
|
||||
'arrPage' => $arrPage,
|
||||
'arrPaginator' => $arrPaginator,
|
||||
'strKeywords' => $strKeywords,
|
||||
'intPage' => $intPage,
|
||||
'arrSearchNovel' => $arrSearchNovel,
|
||||
'intTotalPage' => $arrPage['pages'],
|
||||
'strPageCode' => 'search'
|
||||
]);
|
||||
// echo $strKeywords;exit;
|
||||
if ($boolIsMobile) {
|
||||
return View::fetch();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user