This commit is contained in:
Default
2025-04-19 11:24:54 +08:00
parent 67098a5e01
commit 224e9d4b23
2 changed files with 11 additions and 3 deletions

View File

@@ -168,6 +168,10 @@ class ChapterService
$strCacheKey = '';
$intLifeTime = 0;
if (empty($arrFilter['$and'])) {
$arrFilter = [];
}
# cache filter
if ($intCacheLifeTime > 0) {

View File

@@ -417,7 +417,7 @@ class NovelService
}
# n_category_sex_zh filter
if (!empty($strNSex)) {
if (!empty($strKey)) {
$strKey = mb_substr($strKey, 0, 30);
$arrFilter['$and'][] = [
@@ -454,6 +454,10 @@ class NovelService
$strCacheKey = '';
$intLifeTime = 0;
if (empty($arrFilter['$and'])) {
$arrFilter = [];
}
# cache filter
if ($intCacheLifeTime > 0) {
$strCacheKey = sprintf(
@@ -468,7 +472,7 @@ class NovelService
$intLifeTime = $intLifeTime;
}
$arrNovel = $this->NovelModel->findPaginatedWithCache(
$arrFilter,
$intPage,
@@ -479,7 +483,7 @@ class NovelService
);
$arrPager = call_user_func([$this, $Func], $arrParams, $arrSort, $arrNovel);
// TODO 如果所有筛选条件是 all 目前是返回数据是空的,应该要返回数据
$arrResult = [
'data' => $arrNovel['data'] ?? [],
'pages' => $arrNovel['pages'] ?? 0,