This commit is contained in:
make
2025-05-02 12:04:24 +08:00
parent 7ec3ef4f38
commit 85f2ef5cb2
5 changed files with 389 additions and 24 deletions

View File

@@ -14,6 +14,10 @@ class Video extends TagLib
'sort' => ['attr' => 'd_key,d_val'],
'ranksort' => ['attr' => 'd_key,d_val'],
'status' => ['attr' => 'd_key,d_val'],
'lang' => ['attr' => 'd_key,d_val'],
'area' => ['attr' => 'd_key,d_val'],
'year' => ['attr' => 'd_key,d_val'],
'category' => ['attr' => 'd_key,d_val,v_sex'],
'categorytype' => ['attr' => 'category_type,d_key,d_val,v_sex'],
@@ -285,6 +289,81 @@ EOT;
return $strParse;
}
public function tagLang($tag, $content)
{
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$strParse = <<<EOT
<?php
\$arrVideoLang = app(\\app\\services\\StaticConfig::class)::\$arrVideoLang;
if (!empty(\$arrVideoLang) && is_array(\$arrVideoLang)):
?>
EOT;
$strParse .= <<<EOT
<?php foreach (\$arrVideoLang as \${$d_key} => \${$d_val}): ?>
EOT;
$strParse .= $content;
$strParse .= <<<EOT
<?php endforeach; ?>
<?php endif; ?>
EOT;
return $strParse;
}
public function tagArea($tag, $content)
{
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$strParse = <<<EOT
<?php
\$arrVideoArea = app(\\app\\services\\StaticConfig::class)::\$arrVideoArea;
if (!empty(\$arrVideoArea) && is_array(\$arrVideoArea)):
?>
EOT;
$strParse .= <<<EOT
<?php foreach (\$arrVideoArea as \${$d_key} => \${$d_val}): ?>
EOT;
$strParse .= $content;
$strParse .= <<<EOT
<?php endforeach; ?>
<?php endif; ?>
EOT;
return $strParse;
}
public function tagYear($tag, $content)
{
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$strParse = <<<EOT
<?php
\$arrVideoYear = app(\\app\\services\\StaticConfig::class)::\$arrVideoYear;
if (!empty(\$arrVideoYear) && is_array(\$arrVideoYear)):
?>
EOT;
$strParse .= <<<EOT
<?php foreach (\$arrVideoYear as \${$d_key} => \${$d_val}): ?>
EOT;
$strParse .= $content;
$strParse .= <<<EOT
<?php endforeach; ?>
<?php endif; ?>
EOT;
return $strParse;
}
/**
* 获取排序筛选参数
*