Merge branch 'dev' of ssh://git.bgbg.live:18150/root/SEONexus into dev
This commit is contained in:
@@ -28,6 +28,33 @@ class CategoryModel extends MongoModel
|
||||
9 => '其他小说',
|
||||
];
|
||||
|
||||
static $arrCategoryAll = [
|
||||
'man' => [
|
||||
'xuanhuan-xiuzhen' => '玄幻修真',
|
||||
'junshi-xiaoshuo' => '军史小说',
|
||||
'wangyou-xiaoshuo' => '网游小说',
|
||||
'kehuan-xiaoshuo' => '科幻小说',
|
||||
],
|
||||
'women' => [
|
||||
'zhongsheng-chuanyue' => '重生穿越',
|
||||
'dushi-xiaoshuo' => '都市小说',
|
||||
'lingyi-xiaoshuo' => '灵异小说',
|
||||
'yanqing-xiaoshuo' => '言情小说',
|
||||
'qita-xiaoshuo' => '其他小说',
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param string $strName
|
||||
* @return string
|
||||
*/
|
||||
static public function checkSex(string $strName): string
|
||||
{
|
||||
return in_array($strName, self::$arrMan) ? 'man' : 'women';
|
||||
}
|
||||
|
||||
static $arrCategoryPinYin = [
|
||||
1 => 'xuanhuan-xiuzhen', // 玄幻-修真
|
||||
2 => 'junshi-xiaoshuo', // 军史-小说
|
||||
|
||||
@@ -121,6 +121,11 @@ class NovelModel extends MongoModel
|
||||
$arrOptions = self::$arrNovelOptions;
|
||||
$arrNovel = $this->getOne($arrFilter, $arrOptions);
|
||||
applyToKeys($arrNovel, ['created_at', 'updated_at'], 'formatMongoDate');
|
||||
if (!empty($arrNovel['og_novel_category'])) {
|
||||
$arrNovel['category_pinyin'] = CategoryModel::getPinYinByZh($arrNovel['og_novel_category']);
|
||||
$arrNovel['category_sex'] = CategoryModel::checkSex($arrNovel['og_novel_category']);
|
||||
}
|
||||
|
||||
return $arrNovel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user