debug
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Request;
|
||||
use think\exception\HttpException;
|
||||
|
||||
class AutoSwitchViewModel
|
||||
{
|
||||
static public function getViewConfig(): array
|
||||
{
|
||||
$Request = request();
|
||||
|
||||
$strDomain = $Request->rootDomain();
|
||||
|
||||
$DomainModel = DomainModel::getDomainOnCacheByDomain($strDomain);
|
||||
|
||||
if (empty($DomainModel)) {
|
||||
throw new HttpException(404, 'Site config not Found');
|
||||
}
|
||||
|
||||
$TemplatesModel = TemplatesModel::getTemplateOnCacheByTId($DomainModel->t_id);
|
||||
|
||||
if (empty($DomainModel)) {
|
||||
throw new HttpException(500, 'Site template not Found');
|
||||
}
|
||||
|
||||
$Request->DomainModel = $DomainModel;
|
||||
|
||||
$Request->TemplatesModel = $TemplatesModel;
|
||||
|
||||
return [
|
||||
'type' => 'Think',
|
||||
'auto_rule' => 3,
|
||||
'view_dir_name' => 'view',
|
||||
'view_suffix' => 'html',
|
||||
'view_path' => root_path($TemplatesModel->t_path),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class DomainModel extends BaseModel
|
||||
* Undocumented function
|
||||
*
|
||||
* @param string $strKey
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getFomartSubject($strKey, $strDiff = '', bool $boolJoin = true)
|
||||
{
|
||||
@@ -144,25 +144,5 @@ class DomainModel extends BaseModel
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param array $arrArgs
|
||||
* @return string
|
||||
*/
|
||||
static public function getPageUrl($strKey, array $arrArgs): string
|
||||
{
|
||||
$Request = request();
|
||||
|
||||
$strSfVal = $Request->DomainModel->getFomartSubject($strKey,'',false);
|
||||
$arrKeys = [];
|
||||
$arrVals = [];
|
||||
foreach ($arrArgs as $strKey => $strVal) {
|
||||
$arrKeys[] = '{' . $strKey . '}';
|
||||
$arrVals[] = $strVal;
|
||||
}
|
||||
|
||||
return str_replace($arrKeys, $arrVals, $strSfVal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,139 +482,4 @@ class NovelModel extends MongoModel
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param int $intNId
|
||||
* @param string $intPinYin
|
||||
* @return string
|
||||
*/
|
||||
static public function getNovelInfoUrl($intNId, $intPinYin): string
|
||||
{
|
||||
$strKey = 'NOVEL_INFO_URL';
|
||||
$strUrl = DomainModel::getPageUrl($strKey, [
|
||||
'intNId' => $intNId,
|
||||
'strPinYin' => $intPinYin
|
||||
]);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
* 伪造小说
|
||||
* @param int $intNId
|
||||
* @param string $intPinYin
|
||||
* @return string
|
||||
*/
|
||||
static public function getForgeNovelInfoUrl($intNId, $intPinYin,$intNForgeId): string
|
||||
{
|
||||
$strKey = 'KAN_NOVEL_INFO_URL';
|
||||
$strUrl = DomainModel::getPageUrl($strKey, [
|
||||
'intNId' => $intNId,
|
||||
'strPinYin' => $intPinYin,
|
||||
'intNForgeId' => $intNForgeId,
|
||||
]);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param int $intNId
|
||||
* @param string $intPinYin
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
static public function getNovelChapterUrl($intNId, $intPinYin, $intChapterSort,$intChapterPage=1): string
|
||||
{
|
||||
$strKey = 'CONTENT_INFO_URL';
|
||||
$strUrl = DomainModel::getPageUrl($strKey, [
|
||||
'intNId' => $intNId,
|
||||
'strPinYin' => $intPinYin,
|
||||
'intChapterSort' => $intChapterSort,
|
||||
'intChapterPage' => $intChapterPage,
|
||||
]);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param int $intNId
|
||||
* @param string $intPinYin
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
static public function getNovelLasterChapterUrl($intNId, $intPinYin): string
|
||||
{
|
||||
$strKey = 'NEWS_CONTENT_INFO_URL';
|
||||
$strUrl = DomainModel::getPageUrl($strKey, [
|
||||
'intNId' => $intNId,
|
||||
'strPinYin' => $intPinYin,
|
||||
]);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
* 小说分类
|
||||
* @param int $intNId
|
||||
* @param string $intPinYin
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
static public function getNovelCategoryUrl($strGender, $strCategory, $strStatus, $intPage): string
|
||||
{
|
||||
$strKey = 'CATEGORY_INFO_URL';
|
||||
$strUrl = DomainModel::getPageUrl($strKey, [
|
||||
'strGender' => $strGender,
|
||||
'strCategory' => $strCategory,
|
||||
'strStatus' => $strStatus,
|
||||
'intPage' => $intPage,
|
||||
]);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
* 小说目录
|
||||
* @param int $intNId
|
||||
* @param string $intPinYin
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
static public function getNovelCatalogUrl($intNId, $intPinYin, $strOrder,$intPage=1): string
|
||||
{
|
||||
$strKey = 'NOVEL_CATALOG_URL';
|
||||
$strUrl = DomainModel::getPageUrl($strKey, [
|
||||
'intNId' => $intNId,
|
||||
'strPinYin' => $intPinYin,
|
||||
'strOrder' => $strOrder,
|
||||
'intPage' => $intPage,
|
||||
]);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param int $intPage
|
||||
* @param string $strKeyWords
|
||||
* @return string
|
||||
*/
|
||||
static public function getNovelSearchUrl($strKeyWords, $intPage = 1): string
|
||||
{
|
||||
$strKey = 'SEARCH_INFO_URL';
|
||||
$strUrl = DomainModel::getPageUrl($strKey, [
|
||||
'intPage' => $intPage,
|
||||
'strSearchKeywords' => $strKeyWords
|
||||
]);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user