shikong
This commit is contained in:
@@ -170,6 +170,32 @@ class NovelService
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 排行榜url
|
||||
* Undocumented function
|
||||
*
|
||||
* @param [type] $strGender
|
||||
* @param [type] $strCategory
|
||||
* @param [type] $strStatus
|
||||
* @param [type] $strOrder
|
||||
* @param [type] $intPage
|
||||
* @return string
|
||||
*/
|
||||
public function getNovelRankUrl($strGender, $strCategory, $strStatus, $strOrder, $intPage): string
|
||||
{
|
||||
$strKey = 'RANK_LIST_URL';
|
||||
$strUrl = $this->getPageUrl($strKey, [
|
||||
'strGender' => !empty($strGender) ? $strGender : '',
|
||||
'strCategory' => !empty($strCategory) ? $strCategory : 'all',
|
||||
'strStatus' => !empty($strStatus) ? $strStatus : 'all',
|
||||
'strOrder' => !empty($strOrder) ? $strOrder : 'all',
|
||||
'intPage' => $intPage ?? 1,
|
||||
]);
|
||||
|
||||
$strUrl = preg_replace('#/{2,}#', '/', $strUrl);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
@@ -217,7 +243,7 @@ class NovelService
|
||||
'update' => '最新更新',
|
||||
];
|
||||
|
||||
public $arrRankSortType = [
|
||||
static $arrRankSortType = [
|
||||
'daily' => '天',
|
||||
'weekly' => '周',
|
||||
'monthly' => '月',
|
||||
|
||||
@@ -303,6 +303,22 @@ class SiteContext
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图反向控制器(注释函数),在视图开头调用,用来初始化一些操作。这里尽量不要复杂逻辑。这是个样例
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initRankTKD()
|
||||
{
|
||||
$strOrder = $this->Request->param('strOrder');
|
||||
$strStatus = $this->Request->param('strStatus');
|
||||
ConverterMovel::setVal([
|
||||
'intPage' => 1,
|
||||
'strNovelOrder' => NovelService::$arrRankSortType[$strOrder] ,
|
||||
'strNovelStatus' => NovelService::$arrStatus[$strStatus] ,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user