This commit is contained in:
make
2025-04-21 23:45:10 +08:00
parent f21ece4de1
commit 683424b63e
19 changed files with 231 additions and 96 deletions

View File

@@ -574,6 +574,16 @@ class NovelService
$intLifeTime = $intLifeTime;
}
// 更新值
ConverterMovel::setVal([
'intPage' => $intPage,
// 'strNovelSex' => empty($strNSex) ? '' : $this->arrSex[$strNSex],
'strNovelCategoryName' => empty($strNCategory) ? '' : str_replace("小说", "", $strNCategory),
'strNovelStatus' => empty($strNStatus) ? '' : $this->arrStatus[$strNStatus],
'strNovelOrder' => empty($strSortType) ? '' :$this->arrSortType[$strSortType],
'strSearchKeywords' => $strKey,
]);
if (empty($arrFilter['$and'])) {
$arrFilter = [];
}

View File

@@ -165,6 +165,20 @@ class SiteContext
return ConverterMovel::convert($strTitleTemplate);
}
/**
* 获取 公共替换 变量
*
* @param string $strCode
* @return string
*/
public function getConverterVal(string $strCode): string
{
if (empty($strCode)) {
return ''; // 或返回默认值
}
return ConverterMovel::getVal($strCode);
}
/**
* 获取干扰码
@@ -274,4 +288,21 @@ class SiteContext
'strSiteName' => $this->DomainModel->d_name,
]);
}
/**
* 视图反向控制器(注释函数),在视图开头调用,用来初始化一些操作。这里尽量不要复杂逻辑。这是个样例
*
* @return void
*/
public function initSexTKD()
{
$strSex = $this->Request->param('strChannel');
ConverterMovel::setVal([
'intPage' => 1,
'strNovelSex' => $strSex == 'man' ? '男生' : '女生',
]);
}
}