This commit is contained in:
Default
2025-05-03 23:54:37 +08:00
parent 0cd2fdcdfe
commit 577a4dab02
26 changed files with 1320 additions and 132 deletions

View File

@@ -7,9 +7,9 @@ use think\template\TagLib;
class Video extends TagLib
{
protected $tags = [
'list' => ['attr' => 'count,v_category,sort_type,v_status,v_sex,diff_key,cache_life,d_key,d_val', 'close' => 1],
'pager' => ['attr' => 'page,limit,v_category,sort_type,v_status,v_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 1],
'pagerexp' => ['attr' => 'page,limit,v_class,v_category,sort_type,v_status,v_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 0],
'list' => ['attr' => 'count,v_category,v_parent_category_en,sort_type,v_status,v_sex,diff_key,cache_life,d_key,d_val', 'close' => 1],
'pager' => ['attr' => 'page,limit,v_category,v_parent_category_en,sort_type,v_status,v_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 1],
'pagerexp' => ['attr' => 'page,limit,v_class,v_category,v_parent_category_en,sort_type,v_status,v_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 0],
'info' => ['attr' => 'v_id,v_forge_id,v_key', 'close' => 0],
'sort' => ['attr' => 'd_key,d_val'],
'ranksort' => ['attr' => 'd_key,d_val'],
@@ -17,11 +17,11 @@ class Video extends TagLib
'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'],
'ranklist' => ['attr' => 'count,sort_type,v_status,v_sex,diff_key,cache_life,d_key,d_val', 'close' => 1],
'ranklist' => ['attr' => 'count,sort_type,v_status,v_category_en,v_parent_category_en,diff_key,cache_life,d_key,d_val', 'close' => 1],
];
private function customBuildVar($mixedArgs)
@@ -46,6 +46,9 @@ class Video extends TagLib
$sort_type = $tag['sort_type'] ?? "";
$v_status = $tag['v_status'] ?? "all";
$v_category_en = $tag['v_category_en'] ?? "all";
$v_parent_category_en = $tag['v_parent_category_en'] ?? "all";
$diff_key = $tag['diff_key'] ?? "";
$cache_life = $tag['cache_life'] ?? '0';
$d_key = $tag['d_key'] ?? 'd_key';
@@ -57,12 +60,17 @@ class Video extends TagLib
$diff_key = $this->customBuildVar($diff_key);
$cache_life = $this->customBuildVar($cache_life);
$v_category_en = $this->customBuildVar($v_category_en);
$v_parent_category_en = $this->customBuildVar($v_parent_category_en);
$arrDataName = randomString(5);
$strParse = <<<EOT
<?php
\${$arrDataName} = app(\\app\\services\\VideoService::class)->getRankList([
'count' => {$count},
'v_category_en' => {$v_category_en},
'v_parent_category_en' => {$v_parent_category_en},
'sort_type' => {$sort_type},
'v_status' => {$v_status},
'diff_key' => {$diff_key},
@@ -109,11 +117,9 @@ EOT;
$page = $tag['page'] ?? '0';
$limit = $tag['limit'] ?? '10';
$buttov_num = $tag['buttov_num'] ?? '10';
$v_class = $tag['v_class'] ?? '10';
$v_category = $tag['v_category'] ?? "all";
$v_lang = $tag['v_lang'] ?? "all";
$v_area = $tag['v_area'] ?? "all";
$v_year = $tag['v_year'] ?? "all";
$sort_type = $tag['sort_type'] ?? "";
$v_status = $tag['v_status'] ?? "";
@@ -128,14 +134,20 @@ EOT;
$func = $tag['func'];
$v_category_en = $tag['v_category_en'] ?? "all";
$v_parent_category_en = $tag['v_parent_category_en'] ?? "all";
$v_lang_en = $tag['v_lang_en'] ?? "all";
$v_area_en = $tag['v_area_en'] ?? "all";
$v_year = $tag['v_year'] ?? "all";
$page = $this->customBuildVar($page);
$limit = $this->customBuildVar($limit);
$buttov_num = $this->customBuildVar($buttov_num);
$v_class = $this->customBuildVar($v_class);
$v_category = $this->customBuildVar($v_category);
$v_lang = $this->customBuildVar($v_lang);
$v_area = $this->customBuildVar($v_area);
$v_year = $this->customBuildVar($v_year);
$sort_type = $this->customBuildVar($sort_type);
$v_status = $this->customBuildVar($v_status);
@@ -143,6 +155,12 @@ EOT;
$diff_key = $this->customBuildVar($diff_key);
$cache_life = $this->customBuildVar($cache_life);
$func = $this->customBuildVar($func);
$v_category_en = $this->customBuildVar($v_category_en);
$v_parent_category_en = $this->customBuildVar($v_parent_category_en);
$v_lang_en = $this->customBuildVar($v_lang_en);
$v_area_en = $this->customBuildVar($v_area_en);
$v_year = $this->customBuildVar($v_year);
$arrDataName = randomString(5);
@@ -152,10 +170,10 @@ EOT;
'page' => {$page},
'limit' => {$limit},
'buttov_num' => {$buttov_num},
'v_class' => {$v_class},
'v_category' => {$v_category},
'v_lang' => {$v_lang},
'v_area' => {$v_area},
'v_category_en' => {$v_category_en},
'v_parent_category_en' => {$v_parent_category_en},
'v_lang_en' => {$v_lang_en},
'v_area_en' => {$v_area_en},
'v_year' => {$v_year},
'sort_type' => {$sort_type},
'v_status' => {$v_status},
@@ -204,13 +222,22 @@ EOT;
$cache_life = $tag['cache_life'] ?? '0';
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$v_category_en = $tag['v_category_en'] ?? "all";
$v_parent_category_en = $tag['v_parent_category_en'] ?? "all";
$v_lang_en = $tag['v_lang_en'] ?? "all";
$v_area_en = $tag['v_area_en'] ?? "all";
$v_year = $tag['v_year'] ?? "all";
$v_category = $this->customBuildVar($v_category);
$sort_type = $this->customBuildVar($sort_type);
$v_status = $this->customBuildVar($v_status);
$diff_key = $this->customBuildVar($diff_key);
$cache_life = $this->customBuildVar($cache_life);
$v_category_en = $this->customBuildVar($v_category_en);
$v_parent_category_en = $this->customBuildVar($v_parent_category_en);
$v_lang_en = $this->customBuildVar($v_lang_en);
$v_area_en = $this->customBuildVar($v_area_en);
$v_year = $this->customBuildVar($v_year);
$arrDataName = randomString(5);
@@ -218,7 +245,11 @@ EOT;
<?php
\${$arrDataName} = app(\\app\\services\\VideoService::class)->getVideoList([
'count' => {$count},
'v_category' => {$v_category},
'v_category_en' => {$v_category_en},
'v_parent_category_en' => {$v_parent_category_en},
'v_lang_en' => {$v_lang_en},
'v_area_en' => {$v_area_en},
'v_year' => {$v_year},
'sort_type' => {$sort_type},
'v_status' => {$v_status},
'diff_key' => {$diff_key},