diff --git a/code/app/services/NovelService.php b/code/app/services/NovelService.php index ba28552..379c19d 100644 --- a/code/app/services/NovelService.php +++ b/code/app/services/NovelService.php @@ -318,6 +318,8 @@ class NovelService */ public function getNovelList(array $arrParams): array { + $arrParams['key'] = ''; + $intCount = (int)$arrParams['count'] ?? 10; $strNCategory = $arrParams['n_category'] ?? ''; $strSortType = (string)$arrParams['sort_type'] ?? ''; @@ -414,6 +416,7 @@ class NovelService */ public function getNovelPager(array $arrParams): array { + $arrParams['key'] = ''; $arrParams = [ 'page' => max((int)($arrParams['page'] ?? 1), 1), 'limit' => (int)($arrParams['limit'] ?? 10), diff --git a/code/app/services/VideoService.php b/code/app/services/VideoService.php index cecbf2b..e049164 100644 --- a/code/app/services/VideoService.php +++ b/code/app/services/VideoService.php @@ -106,7 +106,7 @@ class VideoService * @param integer $intPlayIndex * @return string */ - public function getVideoPlayUrl(int $intVId, string $strPinYin,string $strPlayType,int $intPlayIndex): string + public function getVideoPlayUrl(int $intVId, string $strPinYin, string $strPlayType, int $intPlayIndex): string { $strKey = 'VIDEO_PLAY_URL'; $strUrl = $this->SiteContext->DomainModel->getFomartUrl($strKey, [ @@ -118,19 +118,19 @@ class VideoService return (string)$strUrl; } - - /** - * 获取视频分类URl - * - * @param string|NULL $strCategory - * @param string|NULL $strParentCategory - * @param string|NULL $strArea - * @param integer|string|NULL $strLang - * @param integer|string|NULL $strYear - * @param integer|string|NULL $strOrder - * @param integer|string|NULL $intPage - * @return string - */ + + /** + * 获取视频分类URl + * + * @param string|NULL $strCategory + * @param string|NULL $strParentCategory + * @param string|NULL $strArea + * @param integer|string|NULL $strLang + * @param integer|string|NULL $strYear + * @param integer|string|NULL $strOrder + * @param integer|string|NULL $intPage + * @return string + */ public function getVideoCategoryUrl(string|NULL $strCategory, string|NULL $strParentCategory, string|NULL $strArea, int|string|NULL $strLang, int|string|NULL $strYear, int|string|NULL $strOrder, int|string|NULL $intPage): string { $strKey = 'VIDEO_CATEGORY_URL'; @@ -157,9 +157,9 @@ class VideoService * @param integer $intPage * @return string */ - public function getVideoRankUrl(string $strCategory,string $strParentCategory, string $strSortType, int $intPage): string + public function getVideoRankUrl(string $strCategory, string $strParentCategory, string $strSortType, int $intPage): string { - + $strKey = 'VIDEO_RANK_LIST_URL'; $strUrl = $this->SiteContext->DomainModel->getFomartUrl($strKey, [ 'strCategory' => !empty($strCategory) ? $strCategory : 'all', @@ -321,7 +321,7 @@ class VideoService */ public function getVideoList(array $arrParams): array { - + $arrParams['key'] = ''; $intCount = (int)$arrParams['count'] ?? 10; // $strVCategory = $arrParams['v_category'] ?? ''; $strSortType = (string)$arrParams['sort_type'] ?? ''; @@ -332,7 +332,7 @@ class VideoService $strVCategoryEn = (string) $arrParams['v_category_en'] ?? ''; $strVParentCategoryEn = (string) $arrParams['v_parent_category_en'] ?? ''; - + $strVLangEn = (string)$arrParams['v_lang_en'] ?? 'all'; $strVAreaEn = (string)$arrParams['v_area_en'] ?? 'all'; @@ -449,6 +449,7 @@ class VideoService */ public function getVideoPager(array $arrParams): array { + $arrParams['key'] = ''; $arrParams = [ 'page' => max((int)($arrParams['page'] ?? 1), 1), 'limit' => (int)($arrParams['limit'] ?? 10), @@ -506,7 +507,7 @@ class VideoService } } - + # v_year filter if (!empty($strVYear)) { if (key_exists($strVYear, StaticConfig::$arrVideoYear) && $strVYear != 'all') { @@ -605,7 +606,7 @@ class VideoService $intLifeTime = $intLifeTime; } - + // 更新值 ConverterMovel::setVal([ @@ -710,8 +711,8 @@ class VideoService throw new HttpException(404, '视频不存在'); } - if($intVForgeId >= 0 && !empty($arrVideo['v_seo_words'])){ - $arrVideo['v_name'] = $arrVideo['v_seo_words'][$intVForgeId-1]; + if ($intVForgeId >= 0 && !empty($arrVideo['v_seo_words'])) { + $arrVideo['v_name'] = $arrVideo['v_seo_words'][$intVForgeId - 1]; } // 取前5个元素 diff --git a/code/database/mongo/migrations/novel.php b/code/database/mongo/migrations/novel.php index ca81e49..b35cde3 100644 --- a/code/database/mongo/migrations/novel.php +++ b/code/database/mongo/migrations/novel.php @@ -59,5 +59,10 @@ return [ 'key' => ['n_have_chapter' => 1, 'n_forge_novel' => 1], 'options' => ['unique' => false] ], + + [ + 'key' => ['n_forge_novel' => 1], + 'options' => ['unique' => false] + ], ] ];