feat: add metadata workbench and shared seo rules
This commit is contained in:
@@ -88,7 +88,7 @@ class VideoSiteMapLogic
|
||||
*/
|
||||
public function getDomain(): array
|
||||
{
|
||||
if (empty($this->arrDomain)) {
|
||||
if (empty($this->arrDomainModel)) {
|
||||
$this->arrDomainModel = DomainModel::getAllDomainOnCache();
|
||||
}
|
||||
return $this->arrDomainModel;
|
||||
@@ -100,8 +100,26 @@ class VideoSiteMapLogic
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function generateSiteMap()
|
||||
public function generateSiteMap(array $arrTaskData = [])
|
||||
{
|
||||
$arrDomains = array_values(array_unique(array_filter(array_map(
|
||||
static fn($mValue): string => DomainModel::normalizeStoredDomain((string)$mValue),
|
||||
(array)($arrTaskData['domains'] ?? [])
|
||||
))));
|
||||
|
||||
if (!empty($arrDomains)) {
|
||||
$arrAllDomainModel = DomainModel::getAllDomainOnCache();
|
||||
$this->arrDomainModel = array_values(array_filter(
|
||||
$arrAllDomainModel,
|
||||
static fn($DomainModel): bool => in_array((string)$DomainModel->d_domain, $arrDomains, true)
|
||||
));
|
||||
}
|
||||
|
||||
if (empty($this->getDomain())) {
|
||||
echo 'No domains matched for sitemap generation.' . PHP_EOL;
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. 只查一次总数(非常重要)
|
||||
$arrResult = $this->VideoModel->findPaginatedWithCache([], 1, 1);
|
||||
$this->intTotal = $arrResult['total'];
|
||||
|
||||
Reference in New Issue
Block a user