feature view tag get data

This commit is contained in:
Default
2025-04-17 23:16:32 +08:00
parent d6656219ee
commit 7db551a21b
14 changed files with 704 additions and 58 deletions

View File

@@ -16,6 +16,21 @@ class CategoryModel extends MongoModel
protected $strCollection = 'category';
/**
* Undocumented variable
*
* @var CategoryModel
*/
static public $CategoryModel;
static public function getInstance(): self
{
if (self::$CategoryModel == NULL) {
self::$CategoryModel = new self;
}
return self::$CategoryModel;
}
static $arrCategory = [
1 => '玄幻修真',
2 => '军史小说',
@@ -145,6 +160,23 @@ class CategoryModel extends MongoModel
return self::$arrCategoryPinYin[$intKey];
}
/**
* get chinese characters based on pinyin
*
* @param string $strPinYin
* @return string|null
*/
static public function getZhByPinYin(string $strPinYin): string|null
{
$strZh = NULL;
$intKey = array_search($strPinYin, self::$arrCategoryPinYin);
if (is_numeric($intKey)) {
$strZh = self::$arrCategory[$intKey];
}
return $strZh;
}
/**
* determine the gender of the novel category
*

View File

@@ -16,16 +16,16 @@ class NovelClicksModel extends MongoModel
/**
* Undocumented variable
*
* @var self
* @var NovelClicksModel
*/
static public $obj;
static public $NovelClicksModel;
static public function getInstance(): self
{
if (self::$obj == NULL) {
self::$obj = new self;
if (self::$NovelClicksModel == NULL) {
self::$NovelClicksModel = new self;
}
return self::$obj;
return self::$NovelClicksModel;
}
protected $strCollection = 'novel_clicks';