video tag

This commit is contained in:
Default
2025-04-28 18:36:49 +08:00
parent 2958d293d1
commit e452b5ff8b
11 changed files with 352 additions and 263 deletions

View File

@@ -1,114 +1,61 @@
<!-- {site:getval func="strSiteName" /} --> <pre>
<!-- {site:helper func="initHomeTKD" /} -->
<!-- {site:forgelist count="3" d_key="d_key" d_val="novel" cache_life="1000"} {video:ranklist count="10" sort_type="total" n_status="wanjie" d_key="d_key" d_val="video" cache_life="1000"}
<li> <li>
Index: {$d_key} {php}var_dump($video){/php}
Title: {$novel.n_forge_title} 章节名称: {$video.v_name}
Author: {$novel.n_name_pinyin} 章节序号: {$video.v_category}
</li> </li>
{/site:forgelist} --> {/video:ranklist}
<!-- {novel:ranklist count="10" sort_type="total" n_status="wanjie" n_sex="man" d_key="d_key" d_val="novel" cache_life="1000"} <!-- {video:pager page="1" limit="10" d_key="d_key" d_val="video" cache_life="1000" button_num="3" v_category="动作片" v_status="wanjie" sort_type="update" p_val="page_data" func="generateVideoPager"}
<li>
{php}var_dump($novel){/php}
Index: {$d_key}
Title: {$novel.n_name}
Author: {$novel.n_category}
</li>
{/novel:ranklist} -->
<!-- {novel:pagerexp page="1" limit="10" n_category="$Request.route.category" d_key="d_key" d_val="novel" p_val="page_data"
cache_life="1000" func="generateSearchPager" export_name="fadfads" /}
{php}var_dump($fadfads['p_data']);{/php} -->
<!-- {novel:pager page="1" limit="10" n_category="$Request.route.category" d_key="d_key" d_val="novel" p_val="page_data"
cache_life="1000" func="generateSearchPager"}
<li> <li>
Index: {$d_key} Index: {$d_key}
Title: {$novel.n_name} 章节名称: {$video.v_name}
Author: {$novel.n_category} 章节序号: {$video.v_category}
</li> </li>
{/novel:pager} {/video:pager}
{php}var_dump($page_data);{/php} --> {php}var_dump($page_data);{/php} -->
<!--
{video:list count="10" v_category="动作片" v_status="wanjie" sort_type="update" d_key="d_key" d_val="video" cache_life="1000" }
<!-- {site:grm page_code="fdasfadsf" diff="fadsfdsa" num="10" g_key="arrGrm" /}
{php}var_dump($arrGrm);{/php} -->
<!-- {chapter:info n_id="1" c_sort_num="200" c_page="0" c_key="arrChapter01" /}
{$arrChapter01.c_name} -->
<!-- {chapter:pager page="1" limit="10" n_id="$Request.get.n_id" d_key="d_key" d_val="chapter" cache_life="1000" button_num="3" sort_type="dao" p_val="page_data" func="generateChapterPager"}
<li> <li>
Index: {$d_key} Index: {$d_key}
章节名称: {$chapter.c_name} 章节名称: {$video.v_name}
章节序号: {$chapter.c_sort_num} 章节序号: {$video.v_category}
</li> </li>
{/chapter:pager} {/video:list} -->
{php}var_dump($page_data);{/php} -->
<!-- {chapter:list count="10" n_id="$Request.get.n_id" d_key="d_key" d_val="chapter" cache_life="1000"} <!-- {video:info v_id="12" v_key="aaa" /}
{php}print_r($aaa);{/php} -->
<!-- {video:ranksort d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/video:ranksort} -->
<!--
{video:status d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/video:status} -->
<!-- {video:sort d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/video:sort} -->
<!-- {video:category d_key="key" d_val="val"}
<li> <li>
Index: {$d_key} : {$key} - 值: {$val}
章节名称: {$chapter.c_name}
章节序号: {$chapter.c_sort_num}
</li> </li>
{/chapter:list} --> {/video:category} -->
<!--
{novel:category d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/novel:category} -->
<!-- {novel:sex d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/novel:sex} -->
<!--
{novel:status d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/novel:status} -->
<!--
{novel:sort d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/novel:sort} -->
<!--
{novel:info n_id="33" n_key="arrNovel01" n_forge_id="1125940" /}
{$arrNovel01.n_name} -->
<!-- {$DomainModel->d_domain} -->
<!-- {site:replace code="INDEX@INDEX@TITLE"}
-->
<!-- {novel:list count="10" n_category="$Request.route.category" d_key="d_key" d_val="novel" p_val="page_data" cache_life="1000"}
<li>
Index: {$d_key}
Title: {$novel.n_name}
Author: {$novel.n_category}
</li>
{/novel:list} -->
</pre>

View File

@@ -0,0 +1,114 @@
<!-- {site:getval func="strSiteName" /} -->
<!-- {site:helper func="initHomeTKD" /} -->
<!-- {site:forgelist count="3" d_key="d_key" d_val="novel" cache_life="1000"}
<li>
Index: {$d_key}
Title: {$novel.n_forge_title}
Author: {$novel.n_name_pinyin}
</li>
{/site:forgelist} -->
<!-- {novel:ranklist count="10" sort_type="total" n_status="wanjie" n_sex="man" d_key="d_key" d_val="novel" cache_life="1000"}
<li>
{php}var_dump($novel){/php}
Index: {$d_key}
Title: {$novel.n_name}
Author: {$novel.n_category}
</li>
{/novel:ranklist} -->
<!-- {novel:pagerexp page="1" limit="10" n_category="$Request.route.category" d_key="d_key" d_val="novel" p_val="page_data"
cache_life="1000" func="generateSearchPager" export_name="fadfads" /}
{php}var_dump($fadfads['p_data']);{/php} -->
<!-- {novel:pager page="1" limit="10" n_category="$Request.route.category" d_key="d_key" d_val="novel" p_val="page_data"
cache_life="1000" func="generateSearchPager"}
<li>
Index: {$d_key}
Title: {$novel.n_name}
Author: {$novel.n_category}
</li>
{/novel:pager}
{php}var_dump($page_data);{/php} -->
<!-- {site:grm page_code="fdasfadsf" diff="fadsfdsa" num="10" g_key="arrGrm" /}
{php}var_dump($arrGrm);{/php} -->
<!-- {chapter:info n_id="1" c_sort_num="200" c_page="0" c_key="arrChapter01" /}
{$arrChapter01.c_name} -->
<!-- {chapter:pager page="1" limit="10" n_id="$Request.get.n_id" d_key="d_key" d_val="chapter" cache_life="1000" button_num="3" sort_type="dao" p_val="page_data" func="generateChapterPager"}
<li>
Index: {$d_key}
章节名称: {$chapter.c_name}
章节序号: {$chapter.c_sort_num}
</li>
{/chapter:pager}
{php}var_dump($page_data);{/php} -->
<!-- {chapter:list count="10" n_id="$Request.get.n_id" d_key="d_key" d_val="chapter" cache_life="1000"}
<li>
Index: {$d_key}
章节名称: {$chapter.c_name}
章节序号: {$chapter.c_sort_num}
</li>
{/chapter:list} -->
<!--
{novel:category d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/novel:category} -->
<!-- {novel:sex d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/novel:sex} -->
<!--
{novel:status d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/novel:status} -->
<!--
{novel:sort d_key="key" d_val="val"}
<li>
键: {$key} - 值: {$val}
</li>
{/novel:sort} -->
<!--
{novel:info n_id="33" n_key="arrNovel01" n_forge_id="1125940" /}
{$arrNovel01.n_name} -->
<!-- {$DomainModel->d_domain} -->
<!-- {site:replace code="INDEX@INDEX@TITLE"}
-->
<!-- {novel:list count="10" n_category="$Request.route.category" d_key="d_key" d_val="novel" p_val="page_data" cache_life="1000"}
<li>
Index: {$d_key}
Title: {$novel.n_name}
Author: {$novel.n_category}
</li>
{/novel:list} -->

View File

@@ -80,6 +80,16 @@ abstract class MongoModel
{ {
return $this->getCol()->findOne($arrFilter, $arrOptions); return $this->getCol()->findOne($arrFilter, $arrOptions);
} }
/**
* Undocumented function
*
* @param array $arrFilter
* @return array|object|null
*/
public function get(array $arrFilter = [], array $arrOptions = []): array|object|null
{
return $this->getCol()->find($arrFilter, $arrOptions);
}
/** /**
* Undocumented function * Undocumented function

View File

@@ -0,0 +1,86 @@
<?php
declare(strict_types=1);
namespace app\model;
/**
* @mixin think\Model
*/
class VideoCategoryModel extends MongoModel
{
protected $strCollection = 'video_category';
/**
* Undocumented variable
*
* @var VideoCategoryModel
*/
static public $VideoCategoryModel;
static public function getInstance(): self
{
if (self::$VideoCategoryModel == NULL) {
self::$VideoCategoryModel = new self;
}
return self::$VideoCategoryModel;
}
static $arrCategory = [
"da-lu-zong-yi" => "大陆综艺",
"ai-qing-pian" => "爱情片",
"ke-huan-pian" => "科幻片",
"ri-han-zong-yi" => "日韩综艺",
"ri-han-dong-man" => "日韩动漫",
"zhan-zheng-pian" => "战争片",
"ou-mei-ju" => "欧美剧",
"lun-li-pian" => "倫理片",
"han-guo-ju" => "韩国剧",
"yin-le" => "音乐",
"dong-hua-pian" => "动画片",
"guo-chan-dong-man" => "国产动漫",
"kong-bu-pian" => "恐怖片",
"tai-wan-ju" => "台湾剧",
"xiang-gang-ju" => "香港剧",
"xi-ju-pian" => "喜剧片",
"ying-shi" => "影视",
"qi-che" => "汽车",
"ou-mei-zong-yi" => "欧美综艺",
"ju-qing-pian" => "剧情片",
"tai-guo-ju" => "泰国剧",
"hai-wai-ju" => "海外剧",
"guo-chan-ju" => "国产剧",
"fu-li" => "福利",
"ou-mei-dong-man" => "欧美动漫",
"dong-zuo-pian" => "动作片",
"ri-ben-ju" => "日本剧",
"gang-tai-zong-yi" => "港台综艺",
"gang-tai-dong-man" => "港台动漫",
"ji-lu-pian" => "记录片",
"duan-ju-da-quan" => "短剧大全",
"gao-xiao" => "搞笑",
"hai-wai-dong-man" => "海外动漫",
];
/**
* get category of the videos
*
* @return array
*/
static public function getCategory(): array
{
return self::$arrCategory;
}
/**
* get pinyin based on chinese characters
*
* @param string $strZh
* @return string
*/
static public function getZhByPinYin(string $strZh)
{
$strKey = array_search($strZh, self::$arrCategory);
return $strKey === false ?: self::$arrCategory[$strKey];
}
}

View File

@@ -3,6 +3,8 @@
namespace app\services; namespace app\services;
use app\model\CategoryModel; use app\model\CategoryModel;
use app\model\VideoCategoryModel;
use app\model\VideoModel;
class StaticConfig class StaticConfig
{ {
@@ -50,12 +52,19 @@ class StaticConfig
'update' => '最新更新', 'update' => '最新更新',
]; ];
static $arrVideoRankSortType = [
'daily' => '天',
'weekly' => '周',
'monthly' => '月',
'total' => '总',
];
/** /**
* GetCategoryFilter * getNovelCategoryFilter
* *
* @return array * @return array
*/ */
static function getCategoryFilter(string $strNSex = ''): array static function getNovelCategoryFilter(string $strNSex = ''): array
{ {
if ($strNSex == 'man') { if ($strNSex == 'man') {
return CategoryModel::$arrCategoryAll['man']; return CategoryModel::$arrCategoryAll['man'];
@@ -65,4 +74,14 @@ class StaticConfig
return array_combine(CategoryModel::$arrCategoryPinYin, CategoryModel::$arrCategory); return array_combine(CategoryModel::$arrCategoryPinYin, CategoryModel::$arrCategory);
} }
} }
/**
* getNovelCategoryFilter
*
* @return array
*/
static function getVideoCategoryFilter(): array
{
return VideoCategoryModel::$arrCategory;
}
} }

View File

@@ -60,7 +60,7 @@ class VideoService
/** /**
* 获取小说分类URl * 获取视频分类URl
* *
* @param string $strGender * @param string $strGender
* @param string $strCategory * @param string $strCategory
@@ -114,7 +114,7 @@ class VideoService
/** /**
* Undocumented function * Undocumented function
* 小说目录 * 视频目录
* @param int $intVId * @param int $intVId
* @param string $intPinYin * @param string $intPinYin
* @return string * @return string
@@ -151,7 +151,7 @@ class VideoService
} }
/** /**
* 获取排行榜小说 * 获取排行榜视频
* *
* @param array $arrParams * @param array $arrParams
* @return array * @return array
@@ -160,7 +160,7 @@ class VideoService
{ {
$intCount = (int)$arrParams['count'] ?? 10; $intCount = (int)$arrParams['count'] ?? 10;
$strSortType = (string)$arrParams['sort_type'] ?? ''; $strSortType = (string)$arrParams['sort_type'] ?? '';
$strNStatus = (string) $arrParams['v_isend'] ?? ''; $strVStatus = (string) $arrParams['v_status'] ?? '';
$strDiffKey = (string) $arrParams['diff_key'] ?? ''; $strDiffKey = (string) $arrParams['diff_key'] ?? '';
$intCacheLifeTime = (int)$arrParams['cache_life'] ?? 0; $intCacheLifeTime = (int)$arrParams['cache_life'] ?? 0;
@@ -168,8 +168,8 @@ class VideoService
$arrFilter = []; $arrFilter = [];
# v_isend filter # v_isend filter
if (!empty($strNStatus)) { if (!empty($strVStatus)) {
switch ($strNStatus) { switch ($strVStatus) {
case 'lianzai': case 'lianzai':
$arrFilter['v_isend'] = 0; $arrFilter['v_isend'] = 0;
break; break;
@@ -220,10 +220,8 @@ class VideoService
$arrVideo = $this->VideoModel->getRankVideoOnCache( $arrVideo = $this->VideoModel->getRankVideoOnCache(
$strCacheKey, $strCacheKey,
$intCount, $intCount,
$arrFilter['v_category_sex_zh'] ?? 0,
$arrSort['v_sort_type'] ?? 'daily', $arrSort['v_sort_type'] ?? 'daily',
$arrFilter['v_isend'] ?? NULL, $arrFilter['v_status'] ?? NULL,
$intLifeTime,
); );
return $arrVideo; return $arrVideo;
@@ -231,7 +229,7 @@ class VideoService
/** /**
* 获取小说数据 * 获取视频数据
* *
* @param array $arrParams * @param array $arrParams
* @return array * @return array
@@ -241,7 +239,7 @@ class VideoService
$intCount = (int)$arrParams['count'] ?? 10; $intCount = (int)$arrParams['count'] ?? 10;
$strNCategory = $arrParams['v_category'] ?? ''; $strNCategory = $arrParams['v_category'] ?? '';
$strSortType = (string)$arrParams['sort_type'] ?? ''; $strSortType = (string)$arrParams['sort_type'] ?? '';
$strNStatus = (string) $arrParams['v_isend'] ?? ''; $strVStatus = (string) $arrParams['v_status'] ?? '';
$strDiffKey = (string) $arrParams['diff_key'] ?? ''; $strDiffKey = (string) $arrParams['diff_key'] ?? '';
$intCacheLifeTime = (int)$arrParams['cache_life'] ?? 0; $intCacheLifeTime = (int)$arrParams['cache_life'] ?? 0;
@@ -257,18 +255,17 @@ class VideoService
} }
# v_isend filter # v_isend filter
if (!empty($strNStatus)) { if (!empty($strVStatus)) {
switch ($strNStatus) { switch ($strVStatus) {
case 'lianzai': case 'lianzai':
$arrFilter['v_isend'] = StaticConfig::$arrVideoStatus[$strNStatus]; $arrFilter['v_isend'] = 0;
break; break;
case 'wanjie': case 'wanjie':
$arrFilter['v_isend'] = StaticConfig::$arrVideoStatus[$strNStatus]; $arrFilter['v_isend'] = 1;
break; break;
} }
} }
$arrSort = []; $arrSort = [];
# sort filter # sort filter
@@ -281,7 +278,7 @@ class VideoService
$arrSort['v_level'] = -1; $arrSort['v_level'] = -1;
break; break;
case 'update': case 'update':
$arrSort['v_update_time'] = -1; $arrSort['v_publish_date'] = -1;
break; break;
} }
} }
@@ -316,7 +313,7 @@ class VideoService
/** /**
* 获取小说分页数据 * 获取视频分页数据
* *
* @param array $arrParams * @param array $arrParams
* @return array * @return array
@@ -330,7 +327,6 @@ class VideoService
'v_category' => (string)($arrParams['v_category'] ?? ''), 'v_category' => (string)($arrParams['v_category'] ?? ''),
'sort_type' => (string)($arrParams['sort_type'] ?? ''), 'sort_type' => (string)($arrParams['sort_type'] ?? ''),
'v_isend' => (string)($arrParams['v_isend'] ?? ''), 'v_isend' => (string)($arrParams['v_isend'] ?? ''),
'v_sex' => (string)($arrParams['v_sex'] ?? ''),
'diff_key' => (string)($arrParams['diff_key'] ?? ''), 'diff_key' => (string)($arrParams['diff_key'] ?? ''),
'key' => (string)($arrParams['key'] ?? ''), 'key' => (string)($arrParams['key'] ?? ''),
'cache_life' => (int)($arrParams['cache_life'] ?? 0), 'cache_life' => (int)($arrParams['cache_life'] ?? 0),
@@ -341,7 +337,7 @@ class VideoService
$intLimit = $arrParams['limit']; $intLimit = $arrParams['limit'];
$strNCategory = $arrParams['v_category']; $strNCategory = $arrParams['v_category'];
$strSortType = $arrParams['sort_type']; $strSortType = $arrParams['sort_type'];
$strNStatus = $arrParams['v_isend']; $strVStatus = $arrParams['v_isend'];
$strDiffKey = $arrParams['diff_key']; $strDiffKey = $arrParams['diff_key'];
$strKey = $arrParams['key']; $strKey = $arrParams['key'];
@@ -367,13 +363,13 @@ class VideoService
} }
# v_isend filter # v_isend filter
if (!empty($strNStatus)) { if (!empty($strVStatus)) {
switch ($strNStatus) { switch ($strVStatus) {
case 'lianzai': case 'lianzai':
$arrFilter['$and'][] = ['v_isend' => StaticConfig::$arrVideoStatus[$strNStatus]]; $arrFilter['$and'][] = ['v_isend' => 0];
break; break;
case 'wanjie': case 'wanjie':
$arrFilter['$and'][] = ['v_isend' => StaticConfig::$arrVideoStatus[$strNStatus]]; $arrFilter['$and'][] = ['v_isend' => 1];
break; break;
default: default:
$arrParams['v_isend'] = 'all'; $arrParams['v_isend'] = 'all';
@@ -409,7 +405,7 @@ class VideoService
$arrSort['v_level'] = -1; $arrSort['v_level'] = -1;
break; break;
case 'update': case 'update':
$arrSort['v_update_time'] = -1; $arrSort['v_publish_date'] = -1;
break; break;
default: default:
$arrParams['sort_type'] = 'all'; $arrParams['sort_type'] = 'all';
@@ -436,18 +432,11 @@ class VideoService
} }
// 更新值 // 更新值
$strGender = $this->SiteContext->Request->param('strGender');
$strNanUrlTemp = $this->SiteContext->DomainModel->getFomartSubject('NAN_SHENG_URL', '', false);
$strNanUrl = str_replace("/", "", $strNanUrlTemp);
$strCNSex = '全部';
if ($strGender) {
$strCNSex = $strGender == $strNanUrl ? '男生' : '女生';
}
ConverterMovel::setVal([ ConverterMovel::setVal([
'intPage' => $intPage, 'intPage' => $intPage,
'strVideoSex' => $strCNSex, 'strVideoCategoryName' => empty($strNCategory) ? '' : str_replace("视频", "", $strNCategory),
'strVideoCategoryName' => empty($strNCategory) ? '' : str_replace("小说", "", $strNCategory), 'strVideoStatus' => empty($strVStatus) ? '' : StaticConfig::$arrVideoStatus[$strVStatus],
'strVideoStatus' => empty($strNStatus) ? '' : StaticConfig::$arrVideoStatus[$strNStatus],
'strVideoOrder' => empty($strSortType) ? '' : StaticConfig::$arrVideoSortType[$strSortType], 'strVideoOrder' => empty($strSortType) ? '' : StaticConfig::$arrVideoSortType[$strSortType],
'strSearchKeywords' => $strKey, 'strSearchKeywords' => $strKey,
]); ]);
@@ -497,82 +486,54 @@ class VideoService
return $arrPaginator; return $arrPaginator;
} }
/** /**
* 书库/分类定制分页 * 书库/分类定制分页
* *
* @param array $arrFilter 查询条件字段 * @param array $arrFilter 查询条件字段
* @param array $arrSort 查询排序字段 * @param array $arrSort 查询排序字段
* @param array $arrVideo 查询出来的数据 * @param array $arrNovel 查询出来的数据
* @return array * @return array
*/ */
public function generateCategoryPager(array $arrParams, array $arrSort, array $arrVideo): array public function generateVideoPager(array $arrParams, array $arrSort, array $arrVideo): array
{ {
$strGender = $arrParams['v_sex']; $strKey = $arrParams['key'];
$strCategory = $arrParams['v_category']; $intPage = $arrVideo['page'];
$strStatus = $arrParams['v_isend']; $intLimit = $arrVideo['limit'];
$strOrder = $arrParams['sort_type'];
$intPage = $arrVideo['page'] ?? 1;
$intLimit = $arrVideo['limit'] ?? 10;
$intTotal = $arrVideo['total'] ?? 0;
$intButtomNum = $arrParams['buttov_num']; $intButtomNum = $arrParams['buttov_num'];
$strBaseUrl = $this->getVideoCategoryUrl($strGender, $strCategory, $strStatus, $strOrder, '{page}'); $strBaseUrl = app(VideoService::class)->getVideoSearchUrl($strKey, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrVideo['total'], $intLimit, $strBaseUrl, $intButtomNum);
$arrPaginator = CusteomPage02::generate($intPage, $intTotal, $intLimit, $strBaseUrl, $intButtomNum);
return $arrPaginator; return $arrPaginator;
} }
/** /**
* 根据VId获取小说详情 * 根据VId获取视频详情
* *
* @param integer $intVId * @param integer $intVId
* @return void * @return void
*/ */
public function getVideoByVId(int $intVId, int|null $intNForgeId = 0) public function getVideoByVId(int $intVId)
{ {
// 小说详情 // 视频详情
$arrVideo = $this->VideoModel->getVideoByVId($intVId); $arrVideo = $this->VideoModel->getVideoByVId($intVId);
if ($intNForgeId > 0) {
foreach ($arrVideo['v_forge_novel'] as $arrForgeVideo) {
if ($arrForgeVideo['v_forge_id'] == $intNForgeId) {
$arrVideo['v_name'] = $arrForgeVideo['v_forge_title'];
break;
}
}
}
// 分类拼音
$arrVideo['v_category_pinyin'] = CategoryModel::getPinYin($arrVideo['v_category']);
$arrVideo['v_category_sex_en'] = $arrVideo['v_category_sex_en'] ?? 'man';
// 点击数 // 点击数
$arrVideoClicks = $this->VideoClicksModel->getStats($intVId); $arrVideoClicks = $this->VideoClicksModel->getStats($intVId);
// 推荐小说
$arrRelateveVId = array_column($arrVideo['v_related_novel'], 'v_id');
$arrRelateveVideo = $this->VideoModel->findMany(['v_id' => [
'$in' => $arrRelateveVId,
]], 10);
// 更新值 // 更新值
ConverterMovel::setVal([ ConverterMovel::setVal([
'intPage' => 1, 'intPage' => 1,
'strVideoName' => $arrVideo['v_name'], 'strVideoName' => $arrVideo['v_name'],
'strVideoAuthor' => $arrVideo['v_author'],
'strVideoCategoryName' => $arrVideo['v_category'], 'strVideoCategoryName' => $arrVideo['v_category'],
'strVideoSex' => $arrVideo['v_category_sex_en'] == 'man' ? '男生' : '女生',
'strVideoStatus' => $arrVideo['v_isend'], 'strVideoStatus' => $arrVideo['v_isend'],
'strVideoDescription' => $arrVideo['v_description'], 'strVideoDescription' => $arrVideo['v_description'],
]); ]);
$arrVideo['arrVideoClicks'] = $arrVideoClicks; $arrVideo['arrVideoClicks'] = $arrVideoClicks;
$arrVideo['arrRelateveVideo'] = $arrRelateveVideo;
return $arrVideo; return $arrVideo;
} }

View File

@@ -83,6 +83,9 @@ class VideoInfoPage extends BasePage
'url' => $arrVal[1] ?? $arrVal[0], 'url' => $arrVal[1] ?? $arrVal[0],
]; ];
} }
$arrVideo['vod_class'] = trim($arrVideo['vod_class']);
$arrVideo['vod_play_url'][$this->getsite()->getSiteCode()] = $arrPlayUrl; $arrVideo['vod_play_url'][$this->getsite()->getSiteCode()] = $arrPlayUrl;
$arrVideo['vod_actor'] = explode(',', $arrVideo['vod_actor']); $arrVideo['vod_actor'] = explode(',', $arrVideo['vod_actor']);
$arrVideo['vod_director'] = explode(',', $arrVideo['vod_director']); $arrVideo['vod_director'] = explode(',', $arrVideo['vod_director']);

View File

@@ -45,7 +45,7 @@ class SiteMapLogic
public function __construct() public function __construct()
{ {
$this->arrNovelCategory = StaticConfig::getCategoryFilter(); $this->arrNovelCategory = StaticConfig::getNovelCategoryFilter();
$this->arrNovelSort = StaticConfig::$arrNovelSortType; $this->arrNovelSort = StaticConfig::$arrNovelSortType;

View File

@@ -27,7 +27,7 @@ return [
// 自定义标签 // 自定义标签
'taglib_pre_load' => '\\template\\taglib\\Ad,\\template\\taglib\\Site,\\template\\taglib\\Rs,\\template\\taglib\\Novel,\\template\\taglib\\Chapter', 'taglib_pre_load' => '\\template\\taglib\\Ad,\\template\\taglib\\Site,\\template\\taglib\\Rs,\\template\\taglib\\Novel,\\template\\taglib\\Chapter,\\template\\taglib\\Video',
// 模板渲染缓存 // 模板渲染缓存
'display_cache' => env('VIEW_DISPLAY_CACHE', false), 'display_cache' => env('VIEW_DISPLAY_CACHE', false),

View File

@@ -414,7 +414,7 @@ EOT;
$strParse = <<<EOT $strParse = <<<EOT
<?php <?php
\$arrCategory = \\app\\services\\StaticConfig::getCategoryFilter( {$n_sex}); \$arrCategory = \\app\\services\\StaticConfig::getNovelCategoryFilter( {$n_sex});
if (!empty(\$arrCategory) && is_array(\$arrCategory)): if (!empty(\$arrCategory) && is_array(\$arrCategory)):

View File

@@ -7,17 +7,16 @@ use think\template\TagLib;
class Video extends TagLib class Video extends TagLib
{ {
protected $tags = [ protected $tags = [
'list' => ['attr' => 'count,n_category,sort_type,n_status,n_sex,diff_key,cache_life,d_key,d_val', 'close' => 1], '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,n_category,sort_type,n_status,n_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', '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,n_category,sort_type,n_status,n_sex,key,diff_key,cache_life,d_key,d_val,p_val,func,export_name', 'close' => 0], 'pagerexp' => ['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' => 0],
'info' => ['attr' => 'n_id,n_forge_id,n_key', 'close' => 0], 'info' => ['attr' => 'v_id,v_forge_id,v_key', 'close' => 0],
'sort' => ['attr' => 'd_key,d_val'], 'sort' => ['attr' => 'd_key,d_val'],
'ranksort' => ['attr' => 'd_key,d_val'], 'ranksort' => ['attr' => 'd_key,d_val'],
'status' => ['attr' => 'd_key,d_val'], 'status' => ['attr' => 'd_key,d_val'],
'sex' => ['attr' => 'd_key,d_val'], 'category' => ['attr' => 'd_key,d_val,v_sex'],
'category' => ['attr' => 'd_key,d_val,n_sex'],
'ranklist' => ['attr' => 'count,sort_type,n_status,n_sex,diff_key,cache_life,d_key,d_val', 'close' => 1], 'ranklist' => ['attr' => 'count,sort_type,v_status,v_sex,diff_key,cache_life,d_key,d_val', 'close' => 1],
]; ];
private function customBuildVar($mixedArgs) private function customBuildVar($mixedArgs)
@@ -29,8 +28,6 @@ class Video extends TagLib
} }
} }
/** /**
* tagRankList * tagRankList
* *
@@ -42,8 +39,7 @@ class Video extends TagLib
{ {
$count = $tag['count'] ?? '10'; $count = $tag['count'] ?? '10';
$sort_type = $tag['sort_type'] ?? ""; $sort_type = $tag['sort_type'] ?? "";
$n_status = $tag['n_status'] ?? "all"; $v_status = $tag['v_status'] ?? "all";
$n_sex = $tag['n_sex'] ?? "all";
$diff_key = $tag['diff_key'] ?? ""; $diff_key = $tag['diff_key'] ?? "";
$cache_life = $tag['cache_life'] ?? '0'; $cache_life = $tag['cache_life'] ?? '0';
@@ -51,8 +47,8 @@ class Video extends TagLib
$d_val = $tag['d_val'] ?? 'd_val'; $d_val = $tag['d_val'] ?? 'd_val';
$sort_type = $this->customBuildVar($sort_type); $sort_type = $this->customBuildVar($sort_type);
$n_status = $this->customBuildVar($n_status); $v_status = $this->customBuildVar($v_status);
$n_sex = $this->customBuildVar($n_sex);
$diff_key = $this->customBuildVar($diff_key); $diff_key = $this->customBuildVar($diff_key);
$cache_life = $this->customBuildVar($cache_life); $cache_life = $this->customBuildVar($cache_life);
@@ -63,8 +59,7 @@ class Video extends TagLib
\${$arrDataName} = app(\\app\\services\\VideoService::class)->getRankList([ \${$arrDataName} = app(\\app\\services\\VideoService::class)->getRankList([
'count' => {$count}, 'count' => {$count},
'sort_type' => {$sort_type}, 'sort_type' => {$sort_type},
'n_status' => {$n_status}, 'v_status' => {$v_status},
'n_sex' => {$n_sex},
'diff_key' => {$diff_key}, 'diff_key' => {$diff_key},
'cache_life' => {$cache_life} 'cache_life' => {$cache_life}
]); ]);
@@ -108,11 +103,10 @@ EOT;
{ {
$page = $tag['page'] ?? '0'; $page = $tag['page'] ?? '0';
$limit = $tag['limit'] ?? '10'; $limit = $tag['limit'] ?? '10';
$button_num = $tag['button_num'] ?? '10'; $buttov_num = $tag['buttov_num'] ?? '10';
$n_category = $tag['n_category'] ?? "all"; $v_category = $tag['v_category'] ?? "all";
$sort_type = $tag['sort_type'] ?? ""; $sort_type = $tag['sort_type'] ?? "";
$n_status = $tag['n_status'] ?? ""; $v_status = $tag['v_status'] ?? "";
$n_sex = $tag['n_sex'] ?? "";
$key = $tag['key'] ?? ""; $key = $tag['key'] ?? "";
$diff_key = $tag['diff_key'] ?? ""; $diff_key = $tag['diff_key'] ?? "";
$cache_life = $tag['cache_life'] ?? '0'; $cache_life = $tag['cache_life'] ?? '0';
@@ -126,11 +120,11 @@ EOT;
$page = $this->customBuildVar($page); $page = $this->customBuildVar($page);
$limit = $this->customBuildVar($limit); $limit = $this->customBuildVar($limit);
$button_num = $this->customBuildVar($button_num); $buttov_num = $this->customBuildVar($buttov_num);
$n_category = $this->customBuildVar($n_category); $v_category = $this->customBuildVar($v_category);
$sort_type = $this->customBuildVar($sort_type); $sort_type = $this->customBuildVar($sort_type);
$n_status = $this->customBuildVar($n_status); $v_status = $this->customBuildVar($v_status);
$n_sex = $this->customBuildVar($n_sex);
$key = $this->customBuildVar($key); $key = $this->customBuildVar($key);
$diff_key = $this->customBuildVar($diff_key); $diff_key = $this->customBuildVar($diff_key);
$cache_life = $this->customBuildVar($cache_life); $cache_life = $this->customBuildVar($cache_life);
@@ -143,11 +137,10 @@ EOT;
\${$arrDataName} = app(\\app\\services\\VideoService::class)->getVideoPager([ \${$arrDataName} = app(\\app\\services\\VideoService::class)->getVideoPager([
'page' => {$page}, 'page' => {$page},
'limit' => {$limit}, 'limit' => {$limit},
'button_num' => {$button_num}, 'buttov_num' => {$buttov_num},
'n_category' => {$n_category}, 'v_category' => {$v_category},
'sort_type' => {$sort_type}, 'sort_type' => {$sort_type},
'n_status' => {$n_status}, 'v_status' => {$v_status},
'n_sex' => {$n_sex},
'key' => {$key}, 'key' => {$key},
'diff_key' => {$diff_key}, 'diff_key' => {$diff_key},
'cache_life' => {$cache_life}, 'cache_life' => {$cache_life},
@@ -186,20 +179,18 @@ EOT;
public function tagList($tag, $content) public function tagList($tag, $content)
{ {
$count = $tag['count'] ?? '10'; $count = $tag['count'] ?? '10';
$n_category = $tag['n_category'] ?? "all"; $v_category = $tag['v_category'] ?? "all";
$sort_type = $tag['sort_type'] ?? ""; $sort_type = $tag['sort_type'] ?? "";
$n_status = $tag['n_status'] ?? "all"; $v_status = $tag['v_status'] ?? "all";
$n_sex = $tag['n_sex'] ?? "all";
$diff_key = $tag['diff_key'] ?? ""; $diff_key = $tag['diff_key'] ?? "";
$cache_life = $tag['cache_life'] ?? '0'; $cache_life = $tag['cache_life'] ?? '0';
$d_key = $tag['d_key'] ?? 'd_key'; $d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val'; $d_val = $tag['d_val'] ?? 'd_val';
$n_category = $this->customBuildVar($n_category); $v_category = $this->customBuildVar($v_category);
$sort_type = $this->customBuildVar($sort_type); $sort_type = $this->customBuildVar($sort_type);
$n_status = $this->customBuildVar($n_status); $v_status = $this->customBuildVar($v_status);
$n_sex = $this->customBuildVar($n_sex);
$diff_key = $this->customBuildVar($diff_key); $diff_key = $this->customBuildVar($diff_key);
$cache_life = $this->customBuildVar($cache_life); $cache_life = $this->customBuildVar($cache_life);
@@ -209,10 +200,9 @@ EOT;
<?php <?php
\${$arrDataName} = app(\\app\\services\\VideoService::class)->getVideoList([ \${$arrDataName} = app(\\app\\services\\VideoService::class)->getVideoList([
'count' => {$count}, 'count' => {$count},
'n_category' => {$n_category}, 'v_category' => {$v_category},
'sort_type' => {$sort_type}, 'sort_type' => {$sort_type},
'n_status' => {$n_status}, 'v_status' => {$v_status},
'n_sex' => {$n_sex},
'diff_key' => {$diff_key}, 'diff_key' => {$diff_key},
'cache_life' => {$cache_life} 'cache_life' => {$cache_life}
]); ]);
@@ -232,12 +222,8 @@ EOT;
return $strParse; return $strParse;
} }
/** /**
* 获取小说详情 * 获取视频详情
* *
* @param array $tag * @param array $tag
* @param string $content * @param string $content
@@ -245,22 +231,21 @@ EOT;
*/ */
public function tagInfo($tag) public function tagInfo($tag)
{ {
$n_id = $tag['n_id'] ?? '0'; $v_id = $tag['v_id'] ?? '0';
$n_forge_id = isset($tag['n_forge_id']) ? $tag['n_forge_id'] : 0;
$n_key = $tag['n_key'] ?? 'arrVideo'; $v_key = $tag['v_key'] ?? 'arrVideo';
$v_id = $this->customBuildVar($v_id);
$arrDataName = randomString(5);
$n_id = $this->customBuildVar($n_id);
$n_forge_id = $this->customBuildVar($n_forge_id);
$strParse = <<<EOT $strParse = <<<EOT
<?php <?php
\$novelData = app(\\app\\services\\VideoService::class)->getVideoByNId( \${$arrDataName} = app(\\app\\services\\VideoService::class)->getVideoByVId(
{$n_id}, {$v_id}
{$n_forge_id}
); );
\${$n_key} = \$novelData ?? []; \${$v_key} = \${$arrDataName} ?? [];
?> ?>
EOT; EOT;
@@ -363,39 +348,6 @@ EOT;
return $strParse; return $strParse;
} }
/**
* 获取状态筛选参数
*
* @param array $tag
* @param string $content
* @return string
*/
public function tagSex($tag, $content)
{
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$strParse = <<<EOT
<?php
\$arrSex = app(\\app\\services\\StaticConfig::class)::\$arrVideoSex;
if (!empty(\$arrSex) && is_array(\$arrSex)):
?>
EOT;
$strParse .= <<<EOT
<?php foreach (\$arrSex as \${$d_key} => \${$d_val}): ?>
EOT;
$strParse .= $content;
$strParse .= <<<EOT
<?php endforeach; ?>
<?php endif; ?>
EOT;
return $strParse;
}
/** /**
* 获取状态筛选参数 * 获取状态筛选参数
* *
@@ -408,13 +360,10 @@ EOT;
$d_key = $tag['d_key'] ?? 'd_key'; $d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val'; $d_val = $tag['d_val'] ?? 'd_val';
$n_sex = $tag['n_sex'] ?? '';
$n_sex = $this->customBuildVar($n_sex);
$strParse = <<<EOT $strParse = <<<EOT
<?php <?php
\$arrCategory = \\app\\services\\StaticConfig::getCategoryFilter( {$n_sex}); \$arrCategory = \\app\\services\\StaticConfig::getVideoCategoryFilter();
if (!empty(\$arrCategory) && is_array(\$arrCategory)): if (!empty(\$arrCategory) && is_array(\$arrCategory)):