debug
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user