video tag
This commit is contained in:
@@ -80,6 +80,16 @@ abstract class MongoModel
|
||||
{
|
||||
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
|
||||
|
||||
86
code/app/model/VideoCategoryModel.php
Normal file
86
code/app/model/VideoCategoryModel.php
Normal 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];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user