This commit is contained in:
make
2025-04-19 11:11:58 +08:00
parent ed4a97bc19
commit 67098a5e01
6 changed files with 98 additions and 116 deletions

View File

@@ -468,7 +468,7 @@ class NovelService
$intLifeTime = $intLifeTime;
}
$arrNovel = $this->NovelModel->findPaginatedWithCache(
$arrFilter,
$intPage,
@@ -479,10 +479,10 @@ class NovelService
);
$arrPager = call_user_func([$this, $Func], $arrParams, $arrSort, $arrNovel);
// TODO 如果所有筛选条件是 all 目前是返回数据是空的,应该要返回数据
$arrResult = [
'data' => $arrNovel['data'],
'pages' => $arrNovel['pages'],
'data' => $arrNovel['data'] ?? [],
'pages' => $arrNovel['pages'] ?? 0,
'p_data' => $arrPager,
];
@@ -523,11 +523,12 @@ class NovelService
$strCategory = $arrParams['n_category'];
$strStatus = $arrParams['n_status'];
$strOrder = $arrParams['sort_type'];
$intPage = $arrNovel['page'];
$intLimit = $arrNovel['limit'];
$intPage = $arrNovel['page'] ?? 1;
$intLimit = $arrNovel['limit'] ?? 10;
$intTotal = $arrNovel['total'] ?? 0;
$intButtomNum = $arrParams['button_num'];
$strBaseUrl = app(NovelService::class)->getNovelCategoryUrl($strGender, $strCategory, $strStatus, $strOrder, '{page}');
$arrPaginator = CusteomPage02::generate($intPage, $arrNovel['total'], $intLimit, $strBaseUrl, $intButtomNum);
$arrPaginator = CusteomPage02::generate($intPage, $intTotal, $intLimit, $strBaseUrl, $intButtomNum);
return $arrPaginator;
}