debug
This commit is contained in:
@@ -469,7 +469,7 @@ class Novel extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说章节
|
* 章节详情
|
||||||
*
|
*
|
||||||
* @param Request $Request
|
* @param Request $Request
|
||||||
* @param integer $intNovelId 小说id
|
* @param integer $intNovelId 小说id
|
||||||
@@ -481,6 +481,24 @@ class Novel extends BaseController
|
|||||||
{
|
{
|
||||||
$boolIsMobile = $Request->param('boolIsMobile');
|
$boolIsMobile = $Request->param('boolIsMobile');
|
||||||
|
|
||||||
|
|
||||||
|
// 小说详情
|
||||||
|
$NovelModel = new NovelModel;
|
||||||
|
$intNId = $intNovelId;
|
||||||
|
$arrNovel = $NovelModel->getNovelInfo($intNId);
|
||||||
|
|
||||||
|
// 章节
|
||||||
|
$ChapterModel = new ChapterModel;
|
||||||
|
$arrFilter = ['n_id' => $intNId, 'c_sort_num' => $intChapterSort, 'c_page' => $intChapterPage];
|
||||||
|
|
||||||
|
$arrChapter = $ChapterModel->getChapter($arrFilter);
|
||||||
|
|
||||||
|
// 上一章节和下一章节
|
||||||
|
$arrPreChapter = $ChapterModel->getPreChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']);
|
||||||
|
$arrNextChapter = $ChapterModel->getNextChapter($arrChapter['n_id'], $arrChapter['c_sort_num'], $arrChapter['c_page']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 模拟数据
|
// 模拟数据
|
||||||
$arrNewsNovel = [
|
$arrNewsNovel = [
|
||||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||||
|
|||||||
@@ -36,6 +36,28 @@ class ChapterModel extends MongoModel
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Undocumented function
|
||||||
|
*
|
||||||
|
* @param array $arrFilter
|
||||||
|
* @return null|array
|
||||||
|
*/
|
||||||
|
public function getChapter(array $arrFilter): null|array
|
||||||
|
{
|
||||||
|
|
||||||
|
$arrOptions = self::$arrChapterOptions;
|
||||||
|
|
||||||
|
$arrChapter = $this->getOne($arrFilter, $arrOptions);
|
||||||
|
|
||||||
|
if (!empty($arrChapter)) {
|
||||||
|
applyToKeys($arrChapter, ['created_at', 'updated_at'], 'formatMongoDate');
|
||||||
|
|
||||||
|
$arrChapter['content'] = StorageCore::getInstance()->read($arrChapter['c_content_path']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $arrChapter;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Undocumented function
|
* Undocumented function
|
||||||
*
|
*
|
||||||
@@ -125,7 +147,9 @@ class ChapterModel extends MongoModel
|
|||||||
'c_sort_num' => -1,
|
'c_sort_num' => -1,
|
||||||
'c_page' => -1,
|
'c_page' => -1,
|
||||||
];
|
];
|
||||||
return $this->getChapterAll($arrFilter, 1, $arrSort);
|
|
||||||
|
$arrChapterAll = $this->getChapterAll($arrFilter, 1, $arrSort);
|
||||||
|
return $arrChapterAll[0] ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,6 +184,8 @@ class ChapterModel extends MongoModel
|
|||||||
'c_sort_num' => 1,
|
'c_sort_num' => 1,
|
||||||
'c_page' => 1,
|
'c_page' => 1,
|
||||||
];
|
];
|
||||||
return $this->getChapterAll($arrFilter, 1, $arrSort);
|
|
||||||
|
$arrChapterAll = $this->getChapterAll($arrFilter, 1, $arrSort);
|
||||||
|
return $arrChapterAll[0] ?? [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user