init
This commit is contained in:
@@ -27,4 +27,24 @@ class DomainModel extends BaseModel
|
||||
$strKey = "D:" . $strDomain;
|
||||
return Cache::delete($strKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param string $strWords
|
||||
* @return string
|
||||
*/
|
||||
static public function wordsEncode($strWords): string
|
||||
{
|
||||
$Request = request();
|
||||
$intEncode = $Request->DomainModel->d_content_encode;
|
||||
|
||||
if ($intEncode == 1) {
|
||||
$strWords = customEntities($strWords);
|
||||
}
|
||||
|
||||
return $strWords;
|
||||
}
|
||||
}
|
||||
|
||||
38
code/app/model/GanRaoMaModel.php
Normal file
38
code/app/model/GanRaoMaModel.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use DateTime;
|
||||
use Exception;
|
||||
use storage\StorageCore;
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class GanRaoMaModel extends MongoModel
|
||||
{
|
||||
/**
|
||||
* Undocumented variable
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $strCollection = 'gan_rao_ma';
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param string $strDomain
|
||||
* @param string $strPageCode
|
||||
* @param int $intLine
|
||||
* @param string $strDifference
|
||||
* @return string
|
||||
*/
|
||||
static public function getGrmCode($strDomain, $strPageCode, $intLine, $strDifference): string
|
||||
{
|
||||
return (string)mt_rand(1, 100);
|
||||
}
|
||||
}
|
||||
@@ -326,4 +326,32 @@ class NovelModel extends MongoModel
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param int $intNId
|
||||
* @param string $intPinYin
|
||||
* @return string
|
||||
*/
|
||||
static public function getNovelInfoUrl($intNId, $intPinYin): string
|
||||
{
|
||||
$Request = request();
|
||||
$strFomart = $Request->DomainModel->d_novel_info_url_fomart;
|
||||
|
||||
return str_replace(
|
||||
[
|
||||
'{intNId}',
|
||||
'{strPinYin}',
|
||||
],
|
||||
[
|
||||
$intNId,
|
||||
$intPinYin
|
||||
],
|
||||
$strFomart
|
||||
);
|
||||
|
||||
return $strUrl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user