feat: add metadata workbench and shared seo rules

This commit is contained in:
root
2026-04-18 20:23:30 +08:00
parent 2ea87050a5
commit cec1fdbc69
44 changed files with 5488 additions and 68 deletions

View File

@@ -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'];