fix err display

This commit is contained in:
Default
2025-04-29 17:07:26 +08:00
parent 0137ecaa69
commit 9862a1b96a
5 changed files with 165 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ use app\model\ChapterModel;
use app\model\ConverterMovel;
use app\model\NovelModel;
use template\page\CusteomPage02;
use think\exception\HttpException;
use think\facade\View;
class ChapterService
@@ -223,6 +224,10 @@ class ChapterService
// 小说详情
$arrNovel = $this->NovelModel->getNovelByNId($intNId);
if (empty($arrNovel)) {
throw new HttpException(404, '小说不存在');
}
$ChapterModel = ChapterModel::getInstance();
if ($intCSortNum === NULL && $intCPage === NULL) {
// 最新章节
@@ -233,6 +238,12 @@ class ChapterService
$arrChapter = $ChapterModel->findOne($arrFilter);
}
if (empty($arrChapter)) {
throw new HttpException(404, '章节不存在');
}
$strChapterDescription = '';
// 上一章节和下一章节

View File

@@ -9,6 +9,7 @@ use app\model\DomainModel;
use app\model\NovelClicksModel;
use app\model\NovelModel;
use template\page\CusteomPage02;
use think\exception\HttpException;
class NovelService
{
@@ -74,7 +75,7 @@ class NovelService
* @param integer $intNForgeId
* @return string
*/
public function getForgeNovelInfoUrl(int $intNId,string $strPinYin, int $intNForgeId): string
public function getForgeNovelInfoUrl(int $intNId, string $strPinYin, int $intNForgeId): string
{
$strKey = 'KAN_NOVEL_INFO_URL';
$strUrl = $this->SiteContext->DomainModel->getFomartUrl($strKey, [
@@ -164,7 +165,7 @@ class NovelService
*/
public function getNovelRankUrl(string|NULL $strGender, string|NULL $strCategory, string|NULL $strStatus, string|NULL $strOrder, int|NULL $intPage): string
{
$strKey = 'RANK_LIST_URL';
$strUrl = $this->SiteContext->DomainModel->getFomartUrl($strKey, [
'strGender' => !empty($strGender) ? $strGender : '',
@@ -639,6 +640,10 @@ class NovelService
// 小说详情
$arrNovel = $this->NovelModel->getNovelByNId($intNId);
if (empty($arrNovel)) {
throw new HttpException(404, '小说不存在');
}
if ($intNForgeId > 0) {
foreach ($arrNovel['n_forge_novel'] as $arrForgeNovel) {
if ($arrForgeNovel['n_forge_id'] == $intNForgeId) {