diff --git a/code/app/home/view/xiongMao/novel/getNovelRank.html b/code/app/home/view/xiongMao/novel/getNovelRank.html new file mode 100644 index 0000000..e69de29 diff --git a/code/app/services/VideoService.php b/code/app/services/VideoService.php index a7b9d3b..e3463d3 100644 --- a/code/app/services/VideoService.php +++ b/code/app/services/VideoService.php @@ -693,6 +693,9 @@ class VideoService // 取前5个元素 $strTopDirectors = (is_array($arrVideo['v_director'] ?? null)) ? array_slice($arrVideo['v_director'], 0, 5) : ''; + // 取前5个元素 + $strTopLang = (is_array($arrVideo['v_lang'] ?? null)) ? array_slice($arrVideo['v_lang'], 0, 5) : ''; + // 点击数 $arrVideoClicks = $this->VideoClicksModel->getStats($intVId); @@ -704,6 +707,7 @@ class VideoService 'strVideoCategoryName' => $arrVideo['v_category'], 'strVideoStatus' => $arrVideo['v_isend'], 'strVideoDescription' => $arrVideo['v_description'], + 'strLangName' => $strTopLang, 'intPlayIndex' => 1, 'strVideoDirector' => implode(',', $strTopDirectors), 'strVideoActor' => implode(',', $strTopActor), diff --git a/code/app/task/logic/SiteMapLogic.php b/code/app/task/logic/SiteMapLogic.php index b811353..e6afff5 100644 --- a/code/app/task/logic/SiteMapLogic.php +++ b/code/app/task/logic/SiteMapLogic.php @@ -105,7 +105,8 @@ class SiteMapLogic protected function generateMapInfo(int $intPage) { - + $intStartPage = $intPage ; + $intStart = ($intStartPage-=1) * $this->intPageSize; foreach ($this->getDomain() as $DomainModel) { $strDomainDir = $this->strSiteMapPath . $DomainModel->d_domain; @@ -132,13 +133,16 @@ EOF; $strMapBooksFile = sprintf('%s/sitemap-books-catalog-%s.xml', $strDomainDir, $intPage); $strMapCatalogFile = sprintf('%s/sitemap-books-%s.xml', $strDomainDir, $intPage); $strMapChaptersFile = sprintf('%s/sitemap-chapters-%s.xml', $strDomainDir, $intPage); + $strMapBooksFileTxt = sprintf('%s/sitemap-books-%s.txt', $strDomainDir, $intPage); file_put_contents($strMapBooksFile, $strHead); file_put_contents($strMapCatalogFile, $strHead); file_put_contents($strMapChaptersFile, $strHead); + + # 取 intpage * limit ~ intpage * (limit+1) 写入以上文件 - foreach ($this->fetchNovelsByBatch($intPage * $this->intPageSize, $this->intPageSize) as $Novel) { + foreach ($this->fetchNovelsByBatch($intStart, $this->intPageSize) as $Novel) { # 1 $strKey = "NOVEL_INFO_URL"; @@ -155,6 +159,7 @@ EOF; $strPriority = '0.8'; $strContent = sprintf($strTemplate, $strUrl, $strPriority); file_put_contents($strMapBooksFile, $strContent, FILE_APPEND); + file_put_contents($strMapBooksFileTxt, $strUrl . PHP_EOL, FILE_APPEND); # 2 diff --git a/code/app/task/logic/VideoSiteMapLogic.php b/code/app/task/logic/VideoSiteMapLogic.php index 863194a..271397c 100644 --- a/code/app/task/logic/VideoSiteMapLogic.php +++ b/code/app/task/logic/VideoSiteMapLogic.php @@ -117,7 +117,8 @@ class VideoSiteMapLogic protected function generateMapInfo(int $intPage) { - + $intStartPage = $intPage ; + $intStart = ($intStartPage-=1) * $this->intPageSize; foreach ($this->getDomain() as $DomainModel) { $strDomainDir = $this->strSiteMapPath . $DomainModel->d_domain; @@ -142,11 +143,14 @@ EOF; EOF; $strMapVideosFile = sprintf('%s/sitemap-videos-%s.xml', $strDomainDir, $intPage); + $strMapVideosFileTxt = sprintf('%s/sitemap-videos-%s.txt', $strDomainDir, $intPage); file_put_contents($strMapVideosFile, $strHead); + # 取 intpage * limit ~ intpage * (limit+1) 写入以上文件 - foreach ($this->fetchVideosByBatch($intPage * $this->intPageSize, $this->intPageSize) as $Video) { + + foreach ($this->fetchVideosByBatch($intStart, $this->intPageSize) as $Video) { # 1 '/voddetail/{strPinYin}-{intVId}', $strKey = "VIDEO_INFO_URL"; @@ -163,9 +167,12 @@ EOF; $strPriority = '0.8'; $strContent = sprintf($strTemplate, $strUrl, $strPriority); file_put_contents($strMapVideosFile, $strContent, FILE_APPEND); + file_put_contents($strMapVideosFileTxt, $strUrl . PHP_EOL, FILE_APPEND); + } file_put_contents($strMapVideosFile, $strEnd, FILE_APPEND); + } } @@ -182,6 +189,8 @@ EOF; { $intRecordsFetched = 0; $intRemainingRecords = min($intCount, $this->VideoModel->getCol()->countDocuments() - $intStart); + var_dump('$intStart='.$intStart); + var_dump('$intRemainingRecords='.$intRemainingRecords); while ($intRecordsFetched < $intRemainingRecords) { $intLimit = min($this->intBatchSize, $intRemainingRecords - $intRecordsFetched);