feature view tag get data
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user