This commit is contained in:
make
2025-05-05 00:54:34 +08:00
parent bce286a80b
commit cc61365c5d
31 changed files with 1260 additions and 700 deletions

View File

@@ -286,6 +286,34 @@ class StaticConfig
"duan-ju-da-quan" => "短剧",
];
// 测试-没使用到
static $arrVideoClassTest = [
"dian-ying" => "电影",
"dian-shi-ju" => "电视剧",
"zong-yi" => "综艺",
"dong-man" => "动漫",
"duan-ju-da-quan" => "短剧",
"dianying" => "电影",
"dianshiju" => "电视剧",
"zongyi" => "综艺",
"dongman" => "动漫",
"duanjudaquan" => "短剧",
"1" => "电影",
"2" => "电视剧",
"3" => "综艺",
"4" => "动漫",
"5" => "短剧",
"电影" => "电影",
"电视剧" => "电视剧",
"综艺" => "综艺",
"动漫" => "动漫",
"短剧" => "短剧",
];
// 'v_lang', # 视频的语言(如“中文”、“英语”)
// 'v_area', # 视频的地区(如“中国”、“美国”)
// 'v_year', # 视频的发行年份(如 2023

View File

@@ -44,14 +44,14 @@ class VideoService
/**
* 获取视频分类首页 URl
*
* @param string $strClass
* @param string $strParentCategory
* @return string
*/
public function getVideoCategoryIndexUrl(string $strClass): string
public function getVideoCategoryIndexUrl(string $strParentCategory): string
{
$strKey = 'VIDEO_CATEGORY_INDEX_URL';
$strUrl = $this->SiteContext->DomainModel->getFomartUrl($strKey, [
'strClass' => !empty($strClass) ? $strClass : '',
'strParentCategory' => !empty($strParentCategory) ? $strParentCategory : '',
]);
$strUrl = preg_replace('#/{2,}#', '/', $strUrl);
@@ -103,7 +103,7 @@ class VideoService
* 获取视频分类URl
*
* @param string|NULL $strCategory
* @param string|NULL $strClass
* @param string|NULL $strParentCategory
* @param string|NULL $strArea
* @param integer|string|NULL $strLang
* @param integer|string|NULL $strYear
@@ -111,12 +111,12 @@ class VideoService
* @param integer|string|NULL $intPage
* @return string
*/
public function getVideoCategoryUrl(string|NULL $strCategory, string|NULL $strClass, string|NULL $strArea, int|string|NULL $strLang, int|string|NULL $strYear, int|string|NULL $strOrder, int|string|NULL $intPage): string
public function getVideoCategoryUrl(string|NULL $strCategory, string|NULL $strParentCategory, string|NULL $strArea, int|string|NULL $strLang, int|string|NULL $strYear, int|string|NULL $strOrder, int|string|NULL $intPage): string
{
$strKey = 'VIDEO_CATEGORY_URL';
$strUrl = $this->SiteContext->DomainModel->getFomartUrl($strKey, [
'strCategory' => !empty($strCategory) ? $strCategory : 'all',
'strClass' => !empty($strClass) ? $strClass : 'all',
'strParentCategory' => !empty($strParentCategory) ? $strParentCategory : 'all',
'strArea' => !empty($strCategory) ? $strArea : 'all',
'strLang' => !empty($strCategory) ? $strLang : 'all',
'strYear' => !empty($strCategory) ? $strYear : 'all',
@@ -132,18 +132,18 @@ class VideoService
* 排行榜 列表 url
*
* @param string $strCategory
* @param string $strClass
* @param string $strParentCategory
* @param string $strSortType
* @param integer $intPage
* @return string
*/
public function getVideoRankUrl(string $strCategory,string $strClass, string $strSortType, int $intPage): string
public function getVideoRankUrl(string $strCategory,string $strParentCategory, string $strSortType, int $intPage): string
{
$strKey = 'VIDEO_RANK_LIST_URL';
$strUrl = $this->SiteContext->DomainModel->getFomartUrl($strKey, [
'strCategory' => !empty($strCategory) ? $strCategory : 'all',
'strClass' => !empty($strClass) ? $strClass : 'all',
'strParentCategory' => !empty($strParentCategory) ? $strParentCategory : 'all',
'strSortType' => !empty($strSortType) ? $strSortType : 'all',
'intPage' => $intPage ?? 1,
]);
@@ -650,18 +650,18 @@ class VideoService
*/
public function generateVideoPager(array $arrParams, array $arrSort, array $arrVideo): array
{
$strCategory = $arrParams['v_category'];
$strClass = $arrParams['v_class'];
$strArea = $arrParams['v_area'];
$strLang = $arrParams['v_lang'];
$strParentCategory = $arrParams['v_parent_category_en'];
$strCategory = $arrParams['v_category_en'];
$strLang = $arrParams['v_lang_en'];
$strArea = $arrParams['v_area_en'];
$strYear = $arrParams['v_year'];
$strOrder = $arrParams['sort_type'];
$intPage = $arrVideo['page'];
$intLimit = $arrVideo['limit'];
$intButtomNum = $arrParams['buttov_num'];
$strBaseUrl = app(VideoService::class)->getVideoCategoryUrl($strCategory, $strClass, $strArea, $strLang, $strYear, $strOrder, '{page}');
$strBaseUrl = app(VideoService::class)->getVideoCategoryUrl($strCategory, $strParentCategory, $strArea, $strLang, $strYear, $strOrder, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrVideo['total'], $intLimit, $strBaseUrl, $intButtomNum);
return $arrPaginator;