From d17b982cd0d7b7d719462f6cfede9f341b49278b Mon Sep 17 00:00:00 2001 From: make Date: Sat, 3 May 2025 12:48:49 +0800 Subject: [PATCH 1/2] debug --- code/app/home/config/router.php | 51 +++++- code/app/home/view/videoDadi/base.html | 10 +- code/app/home/view/videoDadi/index.md | 4 +- code/app/home/view/videoDadi/index/index.html | 14 +- .../view/videoDadi/public/video-panel.html | 2 +- .../view/videoDadi/video/getCategory.html | 22 ++- .../home/view/videoDadi/video/getRank.html | 105 +++++++++++ .../view/videoDadi/video/getRankList.html | 171 ++++++++++++++++++ code/app/services/SiteContext.php | 2 + code/app/services/VideoService.php | 19 +- code/extend/template/taglib/Site.php | 29 +++ .../initdata/video/baseSubjectFomartGroup.php | 2 +- .../initdata/video/urlSubjectFomartGroup.php | 17 +- doc/TemplateTag.md | 19 +- 14 files changed, 422 insertions(+), 45 deletions(-) create mode 100644 code/app/home/view/videoDadi/video/getRank.html create mode 100644 code/app/home/view/videoDadi/video/getRankList.html diff --git a/code/app/home/config/router.php b/code/app/home/config/router.php index 4323084..e4a9532 100644 --- a/code/app/home/config/router.php +++ b/code/app/home/config/router.php @@ -180,7 +180,23 @@ $arrRoutes = [ ], //排行榜 - 'video_rank_index' => ['/paihang/index', '/rank/index', '/paihang-quan', '/top/index', '/paihang-bang', '/ranks/index', '/sort/index', '/order/index', '/total/index'], + 'video_rank_index' => ['/paihang/index', '/rank/index', '/paihang-quan', '/top/index', '/paihang-bang', '/ranks/index', '/sort/index', '/order/index', '/phb/index'], + + //排行榜 + 'video_rank_list' => [ + '/paihang/:strClass/:strCategory/:strSortType', + '/rank:strCategory/:strClass-:strSortType', + '/:strClass/:strCategory/:strSortType-paihang', + + '/:strCategory/:strClass-:strSortType-top', + '/:strClass-:strSortType/paihangbang-:strCategory', + '/:strClass-:strSortType/:strCategory-ranks', + + '/sort:strCategory/:strClass-:strSortType', + '/:strClass/:strCategory/:strSortType-order', + '/:strClass-:strSortType/:strCategory-phb', + + ], // 视频站点url -- end @@ -404,7 +420,38 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { 'strClass' => '[a-z\-]*', // 允许空值 ]); break; - + + case 'video_rank_index': + $strView = 'pc/getRank.html'; + if ($platform == 'h5') { + $strView = 'video/getRank.html'; + } + //视频排行榜 首页 + Route::get($strRoute, function () use ($strView) { + return view($strView); + }) + ->pattern([ + + ]); + break; + + case 'video_rank_list': + $strView = 'pc/getRankList.html'; + if ($platform == 'h5') { + $strView = 'video/getRankList.html'; + } + //视频分类 分页 + Route::get($strRoute, function () use ($strView) { + return view($strView); + }) + ->pattern([ + 'strClass' => '[a-z\-]*', // 允许空值 + 'strCategory' => '[a-z\-]*', // 允许空值 + 'strSortType' => '[a-z\-]*', // 允许空值 + 'intPage' => '\d*', // 允许空值 + ]); + break; + case 'video_category': $strView = 'pc/getCategory.html'; if ($platform == 'h5') { diff --git a/code/app/home/view/videoDadi/base.html b/code/app/home/view/videoDadi/base.html index 7edd6a5..465d548 100644 --- a/code/app/home/view/videoDadi/base.html +++ b/code/app/home/view/videoDadi/base.html @@ -107,6 +107,10 @@ {/video:categorytype} +
  • + 排行榜 +
  • + @@ -165,7 +169,11 @@ - {site:site valcode="site_tongji" encode="false"/} + + {site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/} + + + {$DomainModel->d_statis|raw} diff --git a/code/app/home/view/videoDadi/index.md b/code/app/home/view/videoDadi/index.md index d7ec7cf..120b38b 100644 --- a/code/app/home/view/videoDadi/index.md +++ b/code/app/home/view/videoDadi/index.md @@ -8,8 +8,8 @@ $v_lang = $tag['v_lang'] ?? "all"; // 语言 $v_area = $tag['v_area'] ?? "all"; // 地区 $v_year = $tag['v_year'] ?? "all"; // 年份 -2. 排行榜标签 怎加 分类查询 -{video:ranklist v_category="$val.v_category_en" +2. 排行榜标签 增加 分类查询 +{video:ranklist v_class="dianying" v_category="$val.v_category_en" diff --git a/code/app/home/view/videoDadi/index/index.html b/code/app/home/view/videoDadi/index/index.html index d74384d..3748355 100644 --- a/code/app/home/view/videoDadi/index/index.html +++ b/code/app/home/view/videoDadi/index/index.html @@ -58,12 +58,12 @@
    - 更多更多

    火爆推荐 + href='{site:vclurl class="all" category="all" area="all" lang="all" year="all" order="tuijian" page="1"/}'>火爆推荐

    @@ -106,24 +106,24 @@
    - {video:categorytype category_type="ONE" d_key="key" d_val="val"} - + {video:ranksort d_key="key" d_val="val"} +
    -

    {$val.v_category}总榜单

    +

    {$val}排行榜

      - {video:ranklist count="10" sort_type="total" d_key="key" d_val="Video" cache_life="86400"} + {video:ranklist count="10" sort_type="$key" d_key="key" d_val="Video" cache_life="86400"} {include file="public/video-list-phb" /} {/video:ranklist}
    - {/video:categorytype} + {/video:ranksort}
    diff --git a/code/app/home/view/videoDadi/public/video-panel.html b/code/app/home/view/videoDadi/public/video-panel.html index 173c852..1962dbc 100644 --- a/code/app/home/view/videoDadi/public/video-panel.html +++ b/code/app/home/view/videoDadi/public/video-panel.html @@ -6,7 +6,7 @@
    更多更多

    diff --git a/code/app/home/view/videoDadi/video/getCategory.html b/code/app/home/view/videoDadi/video/getCategory.html index e9c8916..3a055d0 100644 --- a/code/app/home/view/videoDadi/video/getCategory.html +++ b/code/app/home/view/videoDadi/video/getCategory.html @@ -34,14 +34,14 @@ p_val="page_data" button_num="10" cache_life="86400" func="generateVideoPager" e
  • 按类型
  • + class='{if empty( $Request.route.strCategory) || $Request.route.strCategory == "" || $Request.route.strCategory == "all"}active{/if}'> 全部
  • {video:categorytype category_type="ONE" d_key="key" d_val="val"} {if $val.v_category_en == $Request.route.strClass} {foreach $val.children as $intChildrenKey=>$arrChildrenCategory }
  • + class="{if $Request.route.strCategory == $arrChildrenCategory.v_category_en}active{/if}"> {$arrChildrenCategory.v_category}
  • {/foreach} @@ -52,12 +52,12 @@ p_val="page_data" button_num="10" cache_life="86400" func="generateVideoPager" e
    • 按地区
    • + class='{if empty( $Request.route.strArea) || $Request.route.strArea == "" || $Request.route.strArea == "all"}active{/if}'> 全部
    • {video:area d_key="key" d_val="val"} -
    • +
    • {$val}
    • @@ -67,12 +67,12 @@ p_val="page_data" button_num="10" cache_life="86400" func="generateVideoPager" e
    • 按年份
    • + class='{if empty( $Request.route.strYear) || $Request.route.strYear == "" || $Request.route.strYear == "all"}active{/if}'> 全部
    • {for start="2025" end="1967" comparison="gt" step="-1" name="i"} -
    • +
    • {$i}
    • @@ -82,12 +82,12 @@ p_val="page_data" button_num="10" cache_life="86400" func="generateVideoPager" e
      • 按语言
      • + class='{if empty( $Request.route.strLang) || $Request.route.strLang == "" || $Request.route.strLang == "all"}active{/if}'> 全部
      • {video:lang d_key="key" d_val="val"} -
      • +
      • {$val}
      • @@ -103,7 +103,7 @@ p_val="page_data" button_num="10" cache_life="86400" func="generateVideoPager" e
      - +
      @@ -83,14 +82,14 @@

    类型: - {$arrVideo.v_category} + {$arrVideo.v_category}   {$arrVideo.v_area} + href='{site:vsurl key="$arrVideo.v_area" p="1"/}' >{$arrVideo.v_area}   - {$arrVideo.v_year} + {$arrVideo.v_year}  

    主演: {volist name='$arrVideo.v_actor' id='vo' key='index'} - {$vo} + {$vo}   {/volist}

    导演: {volist name='$arrVideo.v_director' id='vo' key='index'} - {$vo} + {$vo}   {/volist}

    @@ -110,7 +110,7 @@
    - 立即播放 + + 立即播放 +
    - {foreach $arrVideo.v_play_url as $key=>$arrPlayUrlType } + {foreach $arrVideo.v_play_url as $strPlayGroupName=>$arrPlayUrlType }
    @@ -143,15 +145,15 @@
    无需安装任何插件

    - {$key} + {$strPlayGroupName}

    @@ -174,7 +176,7 @@

    {$arrVideo.v_name}

    {$arrVideo.v_description} - {$arrVideo.v_name}   + {$arrVideo.v_name}  

    @@ -197,8 +199,8 @@