This commit is contained in:
Default
2025-04-01 10:52:55 +08:00
parent c7978968f3
commit 85d1d8b6c7
5 changed files with 79 additions and 208 deletions

View File

@@ -114,7 +114,7 @@ class NovelModel extends MongoModel
],
];
$Cursor = $this->getCol()->find($arrFilter, $arrOptions);
$intTotal = $this->getCol()->countDocuments($arrFilter);
@@ -428,7 +428,7 @@ class NovelModel extends MongoModel
* * total 总
* @return array
*/
public function getRankNovelOnCache(string $strSign, int $intCount = 10, int $intType = 0, $strDateType = 'daily'): array
public function getRankNovelOnCache(string $strSign, int $intCount = 10, int $intType = 0, $strDateType = 'daily', $strStatus = NULL): array
{
try {
$strKey = sprintf('%s:PC:HOME:SIX:%s:TYPE:%s', $strSign, $intType, $strDateType);
@@ -442,6 +442,11 @@ class NovelModel extends MongoModel
$arrFilter = [
'nc_type' => $strDateType,
];
if ($strStatus !== NULL) {
$arrFilter['og_novel_status'] = $strStatus;
}
if ($intType == 1) {
$arrCategory = array_values(CategoryModel::getManCategory());
$arrFilter['n_category'] = ['$in' => $arrCategory];
@@ -449,6 +454,8 @@ class NovelModel extends MongoModel
$arrCategory = array_values(CategoryModel::getWomenCategory());
$arrFilter['n_category'] = ['$in' => $arrCategory];
}
$arrOptions = [
'sort' => ['nc_clicks' => -1],
'limit' => $intCount * 3,