This commit is contained in:
somalia
2025-04-06 12:05:02 +08:00
committed by Jerriem
parent 9945b6b137
commit 4eb72f09a4
7 changed files with 26 additions and 6 deletions

View File

@@ -362,11 +362,12 @@ class NovelModel extends MongoModel
$intLifeTime = 24 * 3600;
$arrResult = $this->checkCacheByKey($strKey);
if ($arrResult !== NULL) {
return $arrResult;
}
$this->setCacheByKey($strKey, $arrResult, $intLifeTime);
$arrFilter = [];
switch ($intType) {
case 1:
$arrCategory = array_values(CategoryModel::getManCategory());
@@ -397,10 +398,10 @@ class NovelModel extends MongoModel
],
];
$Cursor = $this->getCol()->find($arrFilter, $arrOptions);
$arrResult = iterator_to_array($Cursor);
shuffle($arrResult);
$arrResult = array_slice($arrResult, 0, $intCount);