This commit is contained in:
make
2025-05-17 19:32:02 +08:00
parent c524f9b6b6
commit 024cc82b50
4 changed files with 22 additions and 4 deletions

View File

@@ -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),

View File

@@ -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

View File

@@ -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);