init
This commit is contained in:
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\admin;
|
||||
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\model\AdminUserModel;
|
||||
use app\admin\service\AdminUserAuth;
|
||||
use app\Request;
|
||||
use think\Container;
|
||||
|
||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\model\AdminUserModel;
|
||||
use app\admin\service\AdminUserAuth;
|
||||
use app\Request;
|
||||
use think\facade\Cache;
|
||||
|
||||
@@ -5,13 +5,13 @@ declare(strict_types=1);
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\admin\model\FenLeiModel;
|
||||
use app\admin\model\GuangGaoFenZuModel;
|
||||
use app\admin\model\GuangGaoModel;
|
||||
use app\admin\model\GuangGaoPeiZhiModel;
|
||||
use app\admin\model\NvYouModel;
|
||||
use app\admin\model\ShiPinModel;
|
||||
use app\model\AdminUserModel;
|
||||
use app\model\FenLeiModel;
|
||||
use app\model\GuangGaoFenZuModel;
|
||||
use app\model\GuangGaoModel;
|
||||
use app\model\GuangGaoPeiZhiModel;
|
||||
use app\model\NvYouModel;
|
||||
use app\model\ShiPinModel;
|
||||
use app\Request;
|
||||
use think\Response;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\model\AdminUserModel;
|
||||
use app\admin\service\AdminUserAuth;
|
||||
use app\Request;
|
||||
use think\facade\Cache;
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\admin\model\BaoYangRuZhuModel;
|
||||
use app\admin\model\CaiJiPeiZhiModel;
|
||||
use app\admin\model\DaLiWanFanKuiModel;
|
||||
use app\admin\model\DaLiWanModel;
|
||||
use app\admin\model\GuanFangZiYingModel;
|
||||
use app\admin\model\LouFengModel;
|
||||
use app\admin\model\PlanTaskModel;
|
||||
use app\admin\model\SeoKeywordsModel;
|
||||
use app\admin\model\SystemConfigModel;
|
||||
use app\admin\model\ZiYuanDuanDianModel;
|
||||
use app\Request;
|
||||
use think\Response;
|
||||
|
||||
class SeoKeywords extends BaseController
|
||||
{
|
||||
|
||||
/**
|
||||
* 系统配置列表
|
||||
*
|
||||
* @param Request $Request
|
||||
* @param AdminUserModel|null $AdminUserModel
|
||||
* @return Response
|
||||
*/
|
||||
public function getSeoKeywordList(Request $Request, ?AdminUserModel $AdminUserModel)
|
||||
{
|
||||
$arrData = [
|
||||
"page" => $Request->get('page', 1),
|
||||
"limit" => $Request->get('limit', 10),
|
||||
"key" => $Request->get('key'),
|
||||
];
|
||||
|
||||
$arrRule = [
|
||||
'page' => 'require|number',
|
||||
'limit' => 'require|number',
|
||||
];
|
||||
|
||||
$this->validate($arrData, $arrRule);
|
||||
|
||||
$SeoKeywordsModel = SeoKeywordsModel::alias('sw');
|
||||
|
||||
if (!empty($arrData['key'])) {
|
||||
$strKey = $arrData['key'];
|
||||
$SeoKeywordsModel->where(function ($SeoKeywordsModel) use ($strKey) {
|
||||
$SeoKeywordsModel->whereOr([
|
||||
['sw.sw_title', 'like', "%" . $strKey . "%"],
|
||||
['sw.sw_id', 'like', "%" . $strKey . "%"],
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
$Paginate = $SeoKeywordsModel->paginate([
|
||||
'list_rows' => $arrData['limit'],
|
||||
'page' => $arrData['page'],
|
||||
]);
|
||||
|
||||
$arrResult = [
|
||||
'items' => $Paginate->items(),
|
||||
'total' => $Paginate->total(),
|
||||
'current_page' => $Paginate->currentPage(),
|
||||
'total_pages' => $Paginate->lastPage(),
|
||||
];
|
||||
|
||||
return $this->success($arrResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置系统配置
|
||||
*
|
||||
* @param Request $Request
|
||||
* @param AdminUserModel|null $AdminUserModel
|
||||
* @return Response
|
||||
*/
|
||||
public function saveSeoKeyword(Request $Request, ?AdminUserModel $AdminUserModel)
|
||||
{
|
||||
$arrData = [
|
||||
"sw_id" => $Request->post('sw_id'),
|
||||
"sw_title" => $Request->post('sw_title'),
|
||||
"sw_status" => $Request->post('sw_status'),
|
||||
"sw_html_path" => $Request->post('sw_html_path') ?? '',
|
||||
];
|
||||
|
||||
$arrRule = [
|
||||
// 'sw_id' => 'require',
|
||||
'sw_title' => 'require',
|
||||
];
|
||||
|
||||
$this->validate($arrData, $arrRule);
|
||||
|
||||
if ($arrData['sw_id'] == NULL) {
|
||||
$SeoKeywordsModel = new SeoKeywordsModel;
|
||||
} else {
|
||||
$SeoKeywordsModel = SeoKeywordsModel::where('sw_id', $arrData['sw_id'])->find();
|
||||
|
||||
if (empty($SeoKeywordsModel)) {
|
||||
return $this->error('9993');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($arrData['sw_status']) && empty($arrData['sw_status']) && $arrData['sw_status'] != 0) {
|
||||
unset($arrData['sw_status']);
|
||||
}
|
||||
if (isset($arrData['sw_html_path']) && empty($arrData['sw_html_path'])) {
|
||||
unset($arrData['sw_html_path']);
|
||||
}
|
||||
|
||||
$SeoKeywordsModel->fill($arrData);
|
||||
|
||||
$SeoKeywordsModel->save();
|
||||
$strHtmlPath = $SeoKeywordsModel->sw_html_path;
|
||||
|
||||
if(!empty($strHtmlPath)){
|
||||
SeoKeywordsModel::flushCache($strHtmlPath);
|
||||
}
|
||||
|
||||
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param Request $Request
|
||||
* @param SeoKeywordsModel|null $SeoKeywordsModel
|
||||
* @return Response
|
||||
*/
|
||||
public function delSeoKeyword(Request $Request, ?SeoKeywordsModel $SeoKeywordsModel)
|
||||
{
|
||||
$arrData = [
|
||||
"sw_id" => $Request->post('sw_id'),
|
||||
];
|
||||
|
||||
$arrRule = [
|
||||
'sw_id' => 'require',
|
||||
];
|
||||
|
||||
$this->validate($arrData, $arrRule);
|
||||
|
||||
$arrData['sw_id'] = explode(',', $arrData['sw_id']);
|
||||
|
||||
SeoKeywordsModel::whereIn('sw_id', $arrData['sw_id'])->delete();
|
||||
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,16 +5,16 @@ declare(strict_types=1);
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\admin\model\BaoYangRuZhuModel;
|
||||
use app\admin\model\CaiJiPeiZhiModel;
|
||||
use app\admin\model\DaLiWanFanKuiModel;
|
||||
use app\admin\model\DaLiWanModel;
|
||||
use app\admin\model\GuanFangZiYingModel;
|
||||
use app\admin\model\LouFengModel;
|
||||
use app\admin\model\PlanTaskModel;
|
||||
use app\admin\model\SystemConfigModel;
|
||||
use app\admin\model\ZiYuanDuanDianModel;
|
||||
use app\model\AdminUserModel;
|
||||
use app\model\BaoYangRuZhuModel;
|
||||
use app\model\CaiJiPeiZhiModel;
|
||||
use app\model\DaLiWanFanKuiModel;
|
||||
use app\model\DaLiWanModel;
|
||||
use app\model\GuanFangZiYingModel;
|
||||
use app\model\LouFengModel;
|
||||
use app\model\PlanTaskModel;
|
||||
use app\model\SystemConfigModel;
|
||||
use app\model\ZiYuanDuanDianModel;
|
||||
use app\Request;
|
||||
use think\Response;
|
||||
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\admin\model\BaoYangRuZhuModel;
|
||||
use app\admin\model\DaLiWanFanKuiModel;
|
||||
use app\admin\model\DaLiWanModel;
|
||||
use app\admin\model\GuanFangZiYingModel;
|
||||
use app\admin\model\LouFengModel;
|
||||
use app\admin\model\SystemConfigModel;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\Request;
|
||||
use think\Response;
|
||||
|
||||
class XiaoShuo extends BaseController
|
||||
{
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param Request $Request
|
||||
* @param AdminUserModel|null $AdminUserModel
|
||||
* @return Response
|
||||
*/
|
||||
public function getXiaoShuoList(Request $Request, ?AdminUserModel $AdminUserModel)
|
||||
{
|
||||
$arrData = [
|
||||
"page" => $Request->get('page', 1),
|
||||
"limit" => $Request->get('limit', 10),
|
||||
"key" => $Request->get('key'),
|
||||
];
|
||||
|
||||
$arrRule = [
|
||||
'page' => 'require|number',
|
||||
'limit' => 'require|number',
|
||||
];
|
||||
|
||||
$this->validate($arrData, $arrRule);
|
||||
|
||||
$XiaoShuoXiangQingModel = XiaoShuoXiangQingModel::alias('xsxq');
|
||||
|
||||
if (!empty($arrData['key'])) {
|
||||
$strKey = $arrData['key'];
|
||||
$XiaoShuoXiangQingModel->where(function ($XiaoShuoXiangQingModel) use ($strKey) {
|
||||
$XiaoShuoXiangQingModel->whereOr([
|
||||
['xsxq.xsxq_ming_zi', 'like', "%" . $strKey . "%"],
|
||||
['xsxq.xsxq_id', 'like', "%" . $strKey . "%"],
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
$Paginate = $XiaoShuoXiangQingModel->paginate([
|
||||
'list_rows' => $arrData['limit'],
|
||||
'page' => $arrData['page'],
|
||||
]);
|
||||
|
||||
$arrResult = [
|
||||
'items' => $Paginate->items(),
|
||||
'total' => $Paginate->total(),
|
||||
'current_page' => $Paginate->currentPage(),
|
||||
'total_pages' => $Paginate->lastPage(),
|
||||
];
|
||||
|
||||
return $this->success($arrResult);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param Request $Request
|
||||
* @param AdminUserModel|null $AdminUserModel
|
||||
* @return Response
|
||||
*/
|
||||
public function getXiaoShuoZhangJieList(Request $Request, ?AdminUserModel $AdminUserModel)
|
||||
{
|
||||
$arrData = [
|
||||
"page" => $Request->get('page', 1),
|
||||
"limit" => $Request->get('limit', 10),
|
||||
"key" => $Request->get('key'),
|
||||
"xsxq_id" => $Request->get('xsxq_id'),
|
||||
];
|
||||
|
||||
$arrRule = [
|
||||
'page' => 'require|number',
|
||||
'limit' => 'require|number',
|
||||
];
|
||||
|
||||
$this->validate($arrData, $arrRule);
|
||||
|
||||
$XiaoShuoZhangJieModel = XiaoShuoZhangJieModel::alias('xszj');
|
||||
|
||||
if (!empty($arrData['key'])) {
|
||||
$strKey = $arrData['key'];
|
||||
$XiaoShuoZhangJieModel->where(function ($XiaoShuoZhangJieModel) use ($strKey) {
|
||||
$XiaoShuoZhangJieModel->whereOr([
|
||||
['xszj.xszj_ming_zi', 'like', "%" . $strKey . "%"],
|
||||
['xszj.xszj_id', 'like', "%" . $strKey . "%"],
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
if (!empty($arrData['xsxq_id'])) {
|
||||
$XiaoShuoZhangJieModel->where('xszj.xsxq_id', $arrData['xsxq_id']);
|
||||
$XiaoShuoZhangJieModel->order('xszj.xszj_pai_xu', 'desc');
|
||||
}
|
||||
|
||||
$Paginate = $XiaoShuoZhangJieModel->paginate([
|
||||
'list_rows' => $arrData['limit'],
|
||||
'page' => $arrData['page'],
|
||||
]);
|
||||
|
||||
$arrResult = [
|
||||
'items' => $Paginate->items(),
|
||||
'total' => $Paginate->total(),
|
||||
'current_page' => $Paginate->currentPage(),
|
||||
'total_pages' => $Paginate->lastPage(),
|
||||
];
|
||||
|
||||
return $this->success($arrResult);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param Request $Request
|
||||
* @param AdminUserModel|null $AdminUserModel
|
||||
* @return Response
|
||||
*/
|
||||
public function getXiaoShuoFenLeiList(Request $Request, ?AdminUserModel $AdminUserModel)
|
||||
{
|
||||
$arrData = [
|
||||
"page" => $Request->get('page', 1),
|
||||
"limit" => $Request->get('limit', 10),
|
||||
"key" => $Request->get('key'),
|
||||
];
|
||||
|
||||
$arrRule = [
|
||||
'page' => 'require|number',
|
||||
'limit' => 'require|number',
|
||||
];
|
||||
|
||||
$this->validate($arrData, $arrRule);
|
||||
|
||||
$XiaoShuoFenLeiModel = XiaoShuoFenLeiModel::alias('xsfl');
|
||||
|
||||
if (!empty($arrData['key'])) {
|
||||
$strKey = $arrData['key'];
|
||||
$XiaoShuoFenLeiModel->where(function ($XiaoShuoFenLeiModel) use ($strKey) {
|
||||
$XiaoShuoFenLeiModel->whereOr([
|
||||
['xsfl.xsfl_name', 'like', "%" . $strKey . "%"],
|
||||
['xsfl.xsfl_id', 'like', "%" . $strKey . "%"],
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
$Paginate = $XiaoShuoFenLeiModel->paginate([
|
||||
'list_rows' => $arrData['limit'],
|
||||
'page' => $arrData['page'],
|
||||
]);
|
||||
|
||||
$arrResult = [
|
||||
'items' => $Paginate->items(),
|
||||
'total' => $Paginate->total(),
|
||||
'current_page' => $Paginate->currentPage(),
|
||||
'total_pages' => $Paginate->lastPage(),
|
||||
];
|
||||
|
||||
return $this->success($arrResult);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\admin\middleware;
|
||||
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\model\AdminUserModel;
|
||||
use app\admin\service\AdminUserAuth;
|
||||
use app\Request;
|
||||
use think\Response;
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\admin\middleware;
|
||||
|
||||
use app\admin\model\AdminUserModel;
|
||||
use app\model\AdminUserModel;
|
||||
use app\admin\service\AdminUserAuth;
|
||||
use app\Request;
|
||||
use think\Response;
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class ContentStatsModel extends BaseModel
|
||||
{
|
||||
protected $name = 'content_stats';
|
||||
protected $pk = 'cs_id';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static public function add($arrData): self
|
||||
{
|
||||
try {
|
||||
$existingRecord = self::where([
|
||||
'cs_md5' => $arrData['cs_md5'],
|
||||
])->find();
|
||||
if ($existingRecord) {
|
||||
$existingRecord->cs_pv = $arrData['cs_pv'];
|
||||
$existingRecord->cs_uv = $arrData['cs_uv'];
|
||||
$existingRecord->updated_at = $arrData['updated_at'];
|
||||
// 尝试保存数据
|
||||
if (!$existingRecord->save()) {
|
||||
// 数据保存失败,抛出异常
|
||||
throw new \RuntimeException('数据保存失败:' . json_encode($data, JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
// 返回模型实例
|
||||
return $existingRecord;
|
||||
// return $existingRecord->save();
|
||||
// return $existingRecord->save($arrData);
|
||||
} else {
|
||||
// 插入新记录
|
||||
return self::create($arrData);
|
||||
}
|
||||
// if ($existingRecord) {
|
||||
// // 更新记录
|
||||
// $existingRecord->cs_pv = $arrData['cs_pv'];
|
||||
// $existingRecord->cs_uv = $arrData['cs_uv'];
|
||||
// $existingRecord->updated_at = $arrData['updated_at'];
|
||||
// $existingRecord->save();
|
||||
|
||||
// return $existingRecord;
|
||||
// }
|
||||
|
||||
// $existingRecord = new self;
|
||||
// $existingRecord->save($arrData);
|
||||
// return $existingRecord;
|
||||
|
||||
} catch (\Throwable $T) {
|
||||
var_dump($T);
|
||||
if ($T->getCode() == 10501) {
|
||||
//return self::addVideoLeixin($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class GanRaoMaModel extends BaseModel
|
||||
{
|
||||
protected $name = 'gan_rao_ma';
|
||||
protected $pk = 'grm_id';
|
||||
|
||||
/**
|
||||
* 根据 HTML 路径获取值
|
||||
* @param string $strHtmlPath
|
||||
* @return string|null
|
||||
*/
|
||||
public static function getValByHtmlPath(string $strHtmlPath): ?string
|
||||
{
|
||||
// 尝试从缓存获取
|
||||
$strGamRaoMa = Cache::get($strHtmlPath);
|
||||
|
||||
// 如果缓存不存在,刷新缓存
|
||||
if (!$strGamRaoMa) {
|
||||
self::flushCache($strHtmlPath);
|
||||
$strGamRaoMa = Cache::get($strHtmlPath);
|
||||
}
|
||||
|
||||
return $strGamRaoMa ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新缓存数据
|
||||
* @param string $strHtmlPath
|
||||
* @return void
|
||||
*/
|
||||
public static function flushCache(string $strHtmlPath): void
|
||||
{
|
||||
// 初始化缓存
|
||||
$cache = Cache::tag('GanRaoMaTag');
|
||||
|
||||
// 尝试从数据库获取
|
||||
$strGamRaoMa = self::where('site_id',config('app.default_app_id'))->where('grm_html_path', $strHtmlPath)->value('grm_neirong');
|
||||
|
||||
if ($strGamRaoMa) {
|
||||
// 设置缓存
|
||||
$cache->set($strHtmlPath, $strGamRaoMa);
|
||||
} else {
|
||||
// 如果数据库中没有记录,生成随机内容
|
||||
$fallbackKeyword = generateRandomHTML(3, 15);
|
||||
|
||||
if ($fallbackKeyword) {
|
||||
$arrGanRaoMa = [
|
||||
'grm_html_path' => $strHtmlPath,
|
||||
'grm_neirong' => $fallbackKeyword,
|
||||
'site_id' => config('app.default_app_id'),
|
||||
];
|
||||
|
||||
// 保存到数据库
|
||||
$model = new self();
|
||||
$model->save($arrGanRaoMa);
|
||||
|
||||
// 设置缓存
|
||||
$cache->set($strHtmlPath, $fallbackKeyword);
|
||||
} else {
|
||||
// 记录日志或其他处理逻辑
|
||||
// Log::warning("No fallback keyword generated for path: $strHtmlPath");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class GuangGaoFenZuModel extends BaseModel
|
||||
{
|
||||
protected $name = 'guang_gao_fen_zu';
|
||||
protected $pk = 'ggfz_id';
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class GuangGaoModel extends BaseModel
|
||||
{
|
||||
protected $name = 'guang_gao';
|
||||
protected $pk = 'gg_id';
|
||||
|
||||
static $arrGuangGao = [];
|
||||
|
||||
static public function getAdByCache($strGGFZCode, $intLimit = 10, $strSort = 'asc')
|
||||
{
|
||||
if (self::$arrGuangGao == []) {
|
||||
self::$arrGuangGao = Cache::get('GuangGao');
|
||||
if (empty(self::$arrGuangGao)) {
|
||||
self::flushCache();
|
||||
self::$arrGuangGao = Cache::get('GuangGao');
|
||||
}
|
||||
}
|
||||
$arrTemp = self::$arrGuangGao[$strGGFZCode] ?? [];
|
||||
|
||||
if ($strSort == 'rand') {
|
||||
shuffle($arrTemp);
|
||||
}
|
||||
|
||||
return array_slice($arrTemp, 0, $intLimit);
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$arrGuangGao = [];
|
||||
$arrGGFZCode = GuangGaoFenZuModel::column('ggfz_code', 'ggfz_id');
|
||||
$GuangGaoModelAll = self::where('site_id',config('app.default_app_id'))->order('ggfz_id', 'desc')->order('gg_sort', 'desc')->where('gg_status',0)->select();
|
||||
|
||||
foreach ($GuangGaoModelAll as $GuangGaoModel) {
|
||||
$GuangGaoModel->ggfz_id;
|
||||
if (!key_exists($GuangGaoModel->ggfz_id, $arrGGFZCode)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!key_exists($arrGGFZCode[$GuangGaoModel->ggfz_id], $arrGuangGao)) {
|
||||
$arrGuangGao[$arrGGFZCode[$GuangGaoModel->ggfz_id]] = [];
|
||||
}
|
||||
|
||||
$arrGuangGao[$arrGGFZCode[$GuangGaoModel->ggfz_id]][] = $GuangGaoModel->toArray();
|
||||
}
|
||||
|
||||
Cache::tag('GuangGao')->set('GuangGao', $arrGuangGao);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class GuangGaoPeiZhiModel extends BaseModel
|
||||
{
|
||||
protected $name = 'guang_gao_pei_zhi';
|
||||
protected $pk = 'ggpz_id';
|
||||
|
||||
static $arrGuangGaoPeiZhi = [];
|
||||
|
||||
static public function getValByCode($strCode)
|
||||
{
|
||||
self::flushCache();
|
||||
if (self::$arrGuangGaoPeiZhi == []) {
|
||||
self::$arrGuangGaoPeiZhi = Cache::get('GuangGaoPeiZhi');
|
||||
|
||||
if (empty(self::$arrGuangGaoPeiZhi)) {
|
||||
self::flushCache();
|
||||
self::$arrGuangGaoPeiZhi = Cache::get('GuangGaoPeiZhi');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrGuangGaoPeiZhi[$strCode] ?? NULL;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$arrGuangGaoPeiZhi = self::column('ggpz_val', 'ggpz_code');
|
||||
Cache::tag('GuangGaoPeiZhi')->set('GuangGaoPeiZhi', $arrGuangGaoPeiZhi);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class NovelInfoSeoModel extends BaseModel
|
||||
{
|
||||
protected $name = 'novel_info_seo';
|
||||
protected $pk = 'nis_id';
|
||||
|
||||
|
||||
|
||||
static public function addXiaoShuoXiangQingSeo($arrData): self
|
||||
{
|
||||
|
||||
try {
|
||||
$XiaoShuoXiangQingModel = self::where('nis_md5', $arrData['nis_md5'])->find();
|
||||
|
||||
if ($XiaoShuoXiangQingModel) {
|
||||
|
||||
return $XiaoShuoXiangQingModel;
|
||||
}
|
||||
|
||||
$XiaoShuoXiangQingModel = new self;
|
||||
|
||||
$XiaoShuoXiangQingModel->save($arrData);
|
||||
return $XiaoShuoXiangQingModel;
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
throw $T; // 超过重试次数后抛出异常
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class ReSouFenZuModel extends BaseModel
|
||||
{
|
||||
protected $name = 're_sou_fen_zu';
|
||||
protected $pk = 'rsfz_id';
|
||||
|
||||
static public function addReSouFenZu($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['rsfz_ming_zi'])) {
|
||||
throw new \Exception("热搜词分组信息不全!");
|
||||
}
|
||||
|
||||
$ReSouFenZuModel = self::where('rsfz_ming_zi', $arrData['rsfz_ming_zi'])->find();
|
||||
if ($ReSouFenZuModel) {
|
||||
return $ReSouFenZuModel;
|
||||
}
|
||||
|
||||
$ReSouFenZuModel = new self;
|
||||
$ReSouFenZuModel->rsfz_pai_xu = $arrData['rsfz_pai_xu'];
|
||||
$ReSouFenZuModel->rsfz_ming_zi = $arrData['rsfz_ming_zi'];
|
||||
$ReSouFenZuModel->save();
|
||||
return $ReSouFenZuModel;
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
if ($T->getCode() == 10501) {
|
||||
return self::addReSouFenZu($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class ReSouModel extends BaseModel
|
||||
{
|
||||
protected $name = 're_sou';
|
||||
protected $pk = 'rs_id';
|
||||
|
||||
static $arrReSou = [];
|
||||
|
||||
static $arrReSouAll = [];
|
||||
|
||||
static public function addReSou($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['rs_ming_zi']) || empty($arrData['rsfz_id'])) {
|
||||
throw new \Exception("热搜词信息不全!");
|
||||
}
|
||||
|
||||
$ReSouModel = self::where('rs_ming_zi', $arrData['rs_ming_zi'])->find();
|
||||
if ($ReSouModel) {
|
||||
return $ReSouModel;
|
||||
}
|
||||
|
||||
$ReSouModel = new self;
|
||||
$ReSouModel->rs_ming_zi = $arrData['rs_ming_zi'];
|
||||
$ReSouModel->rsfz_id = $arrData['rsfz_id'];
|
||||
$ReSouModel->save();
|
||||
return $ReSouModel;
|
||||
} catch (\Throwable $T) {
|
||||
if ($T->getCode() == 10501) {
|
||||
return self::addReSou($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
static public function getRsByCache($intLimit = 2, $strSort = 'asc')
|
||||
{
|
||||
if (self::$arrReSouAll == []) {
|
||||
self::$arrReSouAll = Cache::get('RE_SOU_ALL');
|
||||
|
||||
if (empty(self::$arrReSouAll)) {
|
||||
self::flushCache();
|
||||
self::$arrReSouAll = Cache::get('RE_SOU_ALL');
|
||||
}
|
||||
}
|
||||
$arrTemp = self::$arrReSouAll;
|
||||
|
||||
if ($strSort == 'rand') {
|
||||
shuffle($arrTemp);
|
||||
}
|
||||
|
||||
return array_slice($arrTemp, 0, $intLimit);
|
||||
}
|
||||
|
||||
static public function getFomartDataByCache()
|
||||
{
|
||||
if (self::$arrReSou == []) {
|
||||
self::$arrReSou = Cache::get('RE_SOU');
|
||||
|
||||
if (empty(self::$arrReSou)) {
|
||||
self::flushCache();
|
||||
self::$arrReSou = Cache::get('RE_SOU');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrReSou;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$FenZu = ReSouFenZuModel::order('rsfz_pai_xu', 'asc')->select();
|
||||
$arrFenZu = [];
|
||||
foreach ($FenZu as $FenZuOne) {
|
||||
$arrFenZu[$FenZuOne->rsfz_id] = $FenZuOne->toArray();
|
||||
$arrFenZu[$FenZuOne->rsfz_id]['child'] = [];
|
||||
}
|
||||
|
||||
|
||||
$ReSou = self::select();
|
||||
|
||||
foreach ($ReSou as $ReSouOne) {
|
||||
$arrFenZu[$ReSouOne->rsfz_id]['child'][] = $ReSouOne->toArray();
|
||||
}
|
||||
|
||||
$arrFenZu = array_values($arrFenZu);
|
||||
|
||||
Cache::tag('RE_SOU')->set('RE_SOU', $arrFenZu);
|
||||
Cache::tag('RE_SOU_ALL')->set('RE_SOU_ALL', $ReSou->toArray());
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class SeoHtmlModel extends BaseModel
|
||||
{
|
||||
protected $name = 'seo_html';
|
||||
protected $pk = 'sh_id';
|
||||
|
||||
public static function getValByHtmlPath(string $strHtmlPath): ?string
|
||||
{
|
||||
|
||||
$strSeoKeyword = Cache::get($strHtmlPath);;
|
||||
|
||||
if (!$strSeoKeyword) {
|
||||
|
||||
self::flushCache($strHtmlPath);
|
||||
|
||||
$strSeoKeyword = Cache::get($strHtmlPath);;
|
||||
}
|
||||
|
||||
return $strSeoKeyword ?? null;
|
||||
}
|
||||
|
||||
public static function flushCache(string $strHtmlPath): void
|
||||
{
|
||||
$cache = Cache::tag('SeoKeywords');
|
||||
|
||||
$strSeoKeyword = self::where('sw_html_path', $strHtmlPath)->value('sw_title');
|
||||
|
||||
if ($strSeoKeyword) {
|
||||
|
||||
$cache->set($strHtmlPath, $strSeoKeyword);
|
||||
|
||||
} else {
|
||||
|
||||
$fallbackKeyword = self::where('sw_status', 0)->find();
|
||||
|
||||
if ($fallbackKeyword) {
|
||||
|
||||
$fallbackKeyword->sw_status = 1;
|
||||
|
||||
$fallbackKeyword->sw_html_path = $strHtmlPath;
|
||||
|
||||
$fallbackKeyword->save();
|
||||
|
||||
$cache->set($strHtmlPath, $fallbackKeyword->sw_title);
|
||||
} else {
|
||||
// 如果连 sw_status = 0 的记录也没有,则可以选择不进行任何操作或进行日志记录
|
||||
// Log::warning("No available SEO keyword found for fallback.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class SeoKeywordsModel extends BaseModel
|
||||
{
|
||||
protected $name = 'seo_keywords';
|
||||
protected $pk = 'sw_id';
|
||||
|
||||
public static function getValByHtmlPath(string $strHtmlPath): ?string
|
||||
{
|
||||
|
||||
$strSeoKeyword = Cache::get($strHtmlPath);;
|
||||
|
||||
if (!$strSeoKeyword) {
|
||||
|
||||
self::flushCache($strHtmlPath);
|
||||
|
||||
$strSeoKeyword = Cache::get($strHtmlPath);;
|
||||
}
|
||||
|
||||
return $strSeoKeyword ?? null;
|
||||
}
|
||||
|
||||
public static function flushCache(string $strHtmlPath): void
|
||||
{
|
||||
$cache = Cache::tag('SeoKeywords');
|
||||
|
||||
$strSeoKeyword = self::where('sw_html_path', $strHtmlPath)->value('sw_title');
|
||||
|
||||
if ($strSeoKeyword) {
|
||||
|
||||
$cache->set($strHtmlPath, $strSeoKeyword);
|
||||
|
||||
} else {
|
||||
|
||||
$fallbackKeyword = self::where('sw_status', 0)->find();
|
||||
|
||||
if ($fallbackKeyword) {
|
||||
|
||||
$fallbackKeyword->sw_status = 1;
|
||||
|
||||
$fallbackKeyword->sw_html_path = $strHtmlPath;
|
||||
|
||||
$fallbackKeyword->save();
|
||||
|
||||
$cache->set($strHtmlPath, $fallbackKeyword->sw_title);
|
||||
} else {
|
||||
// 如果连 sw_status = 0 的记录也没有,则可以选择不进行任何操作或进行日志记录
|
||||
// Log::warning("No available SEO keyword found for fallback.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class SeoTdkConfigModel extends BaseModel
|
||||
{
|
||||
protected $name = 'seo_tdk_config';
|
||||
protected $pk = 'stc_id';
|
||||
|
||||
static $arrSeoTdkConfig = [];
|
||||
|
||||
static public function getValByCode($strCode)
|
||||
{
|
||||
|
||||
//self::flushCache();
|
||||
if (self::$arrSeoTdkConfig == []) {
|
||||
self::$arrSeoTdkConfig = Cache::get('seoTdkTonfig');
|
||||
|
||||
if (empty(self::$arrSeoTdkConfig)) {
|
||||
self::flushCache();
|
||||
self::$arrSeoTdkConfig = Cache::get('seoTdkTonfig');
|
||||
}
|
||||
}
|
||||
return self::$arrSeoTdkConfig[$strCode] ?? NULL;
|
||||
}
|
||||
|
||||
// 标签使用
|
||||
static public function getValByCodeByValCode($strCode,$strValCode)
|
||||
{
|
||||
|
||||
if (self::$arrSeoTdkConfig == []) {
|
||||
self::$arrSeoTdkConfig = Cache::get('seoTdkTonfig');
|
||||
|
||||
if (empty(self::$arrSeoTdkConfig)) {
|
||||
self::flushCache();
|
||||
self::$arrSeoTdkConfig = Cache::get('seoTdkTonfig');
|
||||
}
|
||||
}
|
||||
return self::$arrSeoTdkConfig[$strCode][$strValCode] ?? NULL;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
// 查询所有数据
|
||||
$arrSeoTdkConfig = self::where('site_id',config('app.default_app_id'))->select()->toArray();
|
||||
|
||||
// 按照 'stc_code' 进行键值映射
|
||||
$arrSeoTdkConfig = array_column($arrSeoTdkConfig, null, 'stc_code');
|
||||
// var_dump($arrSeoTdkConfig);
|
||||
// $arrSeoTdkConfig = self::select();
|
||||
// $arrSeoTdkConfig = self::column('stc_title', 'stc_code');
|
||||
// var_dump($arrSeoTdkConfig);
|
||||
Cache::tag('seoTdkTonfig')->set('seoTdkTonfig', $arrSeoTdkConfig);
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class SiteModel extends BaseModel
|
||||
{
|
||||
protected $name = 'site';
|
||||
protected $pk = 'site_id';
|
||||
|
||||
static $arrSite = [];
|
||||
|
||||
static public function addSite($arrData): self
|
||||
{
|
||||
|
||||
try {
|
||||
$SiteModel = self::where('site_name', $arrData['site_name'])->find();
|
||||
|
||||
if ($SiteModel) {
|
||||
|
||||
return $SiteModel;
|
||||
}
|
||||
|
||||
$SiteModel = new self;
|
||||
|
||||
$SiteModel->save($arrData);
|
||||
return $SiteModel;
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
throw $T; // 超过重试次数后抛出异常
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static public function getValById($intSiteId)
|
||||
{
|
||||
|
||||
//self::flushCache();
|
||||
if (self::$arrSite == []) {
|
||||
self::$arrSite = Cache::get('site');
|
||||
|
||||
if (empty(self::$arrSite)) {
|
||||
self::flushCache();
|
||||
self::$arrSite = Cache::get('site');
|
||||
}
|
||||
}
|
||||
return self::$arrSite[$intSiteId] ?? NULL;
|
||||
}
|
||||
|
||||
// 标签使用
|
||||
static public function getValBySiteIdByValCode($strValCode)
|
||||
{
|
||||
|
||||
if (self::$arrSite == []) {
|
||||
self::$arrSite = Cache::get('site');
|
||||
|
||||
if (empty(self::$arrSite)) {
|
||||
self::flushCache();
|
||||
self::$arrSite = Cache::get('site');
|
||||
}
|
||||
}
|
||||
return self::$arrSite[config('app.default_app_id')][$strValCode] ?? NULL;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
// 查询所有数据 where('site_id',config('app.default_app_id'))
|
||||
$arrSite = self::select()->toArray();
|
||||
|
||||
// 按照 'stc_code' 进行键值映射
|
||||
$arrSite = array_column($arrSite, null, 'site_id');
|
||||
|
||||
Cache::tag('site')->set('site', $arrSite);
|
||||
}
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoClassModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_class';
|
||||
protected $pk = 'vc_id';
|
||||
|
||||
static $arrVideoShuoFenLei = [];
|
||||
|
||||
static public function addVideoFenLei($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['vc_name'])) {
|
||||
throw new \Exception("分类信息不全!");
|
||||
}
|
||||
|
||||
$VideoFenLeiModel = self::where('vc_name', $arrData['vc_name'])->find();
|
||||
if ($VideoFenLeiModel) {
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
$VideoFenLeiModel = new self;
|
||||
$VideoFenLeiModel->vc_name = $arrData['vc_name'];
|
||||
$VideoFenLeiModel->save();
|
||||
return $VideoFenLeiModel;
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
if ($T->getCode() == 10501) {
|
||||
return self::addVideoFenLei($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
static public function getIdByName($strName)
|
||||
{
|
||||
$intId = 0;
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vc_name'] == $strName) {
|
||||
$intId = $arrFenLei['vc_id'];
|
||||
}
|
||||
}
|
||||
return $intId;
|
||||
}
|
||||
|
||||
static public function getNameById($intId)
|
||||
{
|
||||
static::getDataByCache();
|
||||
$strName = '未知';
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vc_id'] === $intId) {
|
||||
$strName = $arrFenLei['vc_name'];
|
||||
}
|
||||
}
|
||||
return $strName;
|
||||
}
|
||||
|
||||
static public function getInfoById($intId)
|
||||
{
|
||||
$arrDefault = ['vc_id' => 1, 'vc_name' => '电影' , 'vc_necheng' => 'dy'];
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vc_id'] == $intId) {
|
||||
$arrDefault = $arrFenLei;
|
||||
}
|
||||
}
|
||||
return $arrDefault;
|
||||
}
|
||||
|
||||
static public function getInfoByNeCheng($strNeCheng)
|
||||
{
|
||||
$arrDefault = ['vc_id' => 1, 'vc_source_id' => 1,'vc_name' => '电影' , 'vc_necheng' => 'dy'];
|
||||
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vc_nicheng'] == $strNeCheng) {
|
||||
$arrDefault = $arrFenLei;
|
||||
}
|
||||
}
|
||||
return $arrDefault;
|
||||
}
|
||||
|
||||
|
||||
static public function getDataByCache()
|
||||
{
|
||||
if (self::$arrVideoShuoFenLei == []) {
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_FEN_LEI');
|
||||
|
||||
if (empty(self::$arrVideoShuoFenLei)) {
|
||||
self::flushCache();
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_FEN_LEI');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrVideoShuoFenLei;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$arrVideoShuoFenLei = self::where('vc_status', 1)->where('site_id',config('app.default_app_id'))->order('vc_sort', 'asc')->select()->toArray();
|
||||
self::$arrVideoShuoFenLei = $arrVideoShuoFenLei;
|
||||
Cache::tag('VIDEO_FEN_LEI')->set('VIDEO_FEN_LEI', $arrVideoShuoFenLei);
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoDiquModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_diqu';
|
||||
protected $pk = 'vd_id';
|
||||
|
||||
static $arrVideoShuoFenLei = [];
|
||||
|
||||
static public function add($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['vd_name'])) {
|
||||
throw new \Exception("地区信息不全!");
|
||||
}else{
|
||||
$VideoFenLeiModel = self::where('vd_name', $arrData['vd_name'])->where('vc_id', $arrData['vc_id'])->find();
|
||||
if ($VideoFenLeiModel) {
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
$VideoFenLeiModel = new self;
|
||||
$VideoFenLeiModel->save($arrData);
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
if ($T->getCode() == 10501) {
|
||||
//return self::add($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
static public function getIdByName($strName)
|
||||
{
|
||||
$intId = 0;
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vd_name'] == $strName) {
|
||||
$intId = $arrFenLei['vd_id'];
|
||||
}
|
||||
}
|
||||
return $intId;
|
||||
}
|
||||
|
||||
static public function getNameById($intId)
|
||||
{
|
||||
static::getDataByCache();
|
||||
$strName = '未知';
|
||||
// var_dump(self::$arrXiaoShuoFenLei);
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vd_id'] === $intId) {
|
||||
$strName = $arrFenLei['vd_name'];
|
||||
}
|
||||
}
|
||||
return $strName;
|
||||
}
|
||||
|
||||
static public function getDataByCache()
|
||||
{
|
||||
if (self::$arrVideoShuoFenLei == []) {
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_DI_QU');
|
||||
|
||||
if (empty(self::$arrVideoShuoFenLei)) {
|
||||
self::flushCache();
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_DI_QU');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrVideoShuoFenLei;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$arrVideoShuoFenLei = self::select()->toArray();
|
||||
|
||||
Cache::tag('VIDEO_DI_QU')->set('VIDEO_DI_QU', $arrVideoShuoFenLei);
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoInfoModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_info';
|
||||
protected $pk = 'v_id';
|
||||
|
||||
protected $append = [
|
||||
'video_feng_mian_url',
|
||||
'vc_name',
|
||||
'arr_daoyan',
|
||||
'arr_zhuyan',
|
||||
'arr_juqing',
|
||||
];
|
||||
|
||||
public function getArrDaoyanAttr($value, $data)
|
||||
{
|
||||
if(!empty($data['v_daoyan'])){
|
||||
$arrDaoyan = explode(",", $data['v_daoyan']);
|
||||
return $arrDaoyan;
|
||||
}
|
||||
}
|
||||
|
||||
public function getArrZhuyanAttr($value, $data)
|
||||
{
|
||||
if(!empty($data['v_zhuyan'])){
|
||||
$arrZhuyan = explode(",", $data['v_zhuyan']);
|
||||
return $arrZhuyan;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getArrJuqingAttr($value, $data)
|
||||
{
|
||||
if(!empty($data['v_juqing'])){
|
||||
$arrJuqing = explode(",", $data['v_juqing']);
|
||||
return $arrJuqing;
|
||||
}
|
||||
}
|
||||
|
||||
public function getVideoFengMianUrlAttr($value, $data)
|
||||
{
|
||||
// 检查 v_cover 字段是否存在并解析 JSON 数据
|
||||
$arrUrl = isset($data['v_cover']) ? json_decode($data['v_cover'], true) : null;
|
||||
|
||||
if (json_last_error() !== JSON_ERROR_NONE || !is_array($arrUrl)) {
|
||||
// 如果 JSON 解析失败或结果不是数组,返回默认值
|
||||
return null; // 或者返回一个默认图片地址,例如: '/static/images/default.png'
|
||||
}
|
||||
|
||||
// 解析域名 (可替换成动态域名获取逻辑)
|
||||
// $strDomain = ZiYuanDuanDianModel::getDomainByCode($arrUrl['code']);
|
||||
// $strDomain = "https://www.123yqw.com";
|
||||
|
||||
// 构造完整的封面 URL
|
||||
$uri = $arrUrl['uri'] ?? null;
|
||||
|
||||
if (!$uri) {
|
||||
// 如果没有 URI 字段,返回默认值
|
||||
return null; // 或默认图片地址
|
||||
}
|
||||
|
||||
// 返回完整 URL (如果需要加域名,可在此处理)
|
||||
return $uri; // 或 "{$strDomain}{$uri}" 如果域名需要拼接
|
||||
}
|
||||
|
||||
|
||||
public function getXsxqTagAttr($value, $data)
|
||||
{
|
||||
return json_decode($data['xsxq_tag'], true);
|
||||
}
|
||||
|
||||
public function getXsflNameAttr($value, $data)
|
||||
{
|
||||
$strXiaoShuoFenLeiName = XiaoShuoFenLeiModel::getNameById($data['xsfl_id']);
|
||||
|
||||
return $strXiaoShuoFenLeiName;
|
||||
}
|
||||
|
||||
static public function addVideoXiangQing($arrData): array
|
||||
{
|
||||
try {
|
||||
$VideoXiangQingModel = self::where('v_md5', $arrData['v_md5'])->find();
|
||||
|
||||
if ($VideoXiangQingModel) {
|
||||
|
||||
return [
|
||||
'model' => $VideoXiangQingModel,
|
||||
'isNew' => false, // 已存在
|
||||
];
|
||||
}
|
||||
$VideoXiangQingModel = new self;
|
||||
$VideoXiangQingModel->save($arrData);
|
||||
return [
|
||||
'model' => $VideoXiangQingModel,
|
||||
'isNew' => true, // 新增
|
||||
];
|
||||
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
throw $T; // 超过重试次数后抛出异常
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoInfoSeoModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_info_seo';
|
||||
protected $pk = 'vis_id';
|
||||
|
||||
|
||||
|
||||
static public function addVideoSeo($arrData): self
|
||||
{
|
||||
|
||||
try {
|
||||
$VideoModel = self::where('vis_md5', $arrData['vis_md5'])->find();
|
||||
|
||||
if ($VideoModel) {
|
||||
|
||||
return $VideoModel;
|
||||
}
|
||||
|
||||
$VideoModel = new self;
|
||||
|
||||
$VideoModel->save($arrData);
|
||||
return $VideoModel;
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
throw $T; // 超过重试次数后抛出异常
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoJuqingModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_juqing';
|
||||
protected $pk = 'vj_id';
|
||||
|
||||
static $arrVideoShuoFenLei = [];
|
||||
|
||||
static public function add($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['vj_name'])) {
|
||||
throw new \Exception("剧情信息不全!");
|
||||
}else{
|
||||
$VideoFenLeiModel = self::where('vj_name', $arrData['vj_name'])->where('vc_id', $arrData['vc_id'])->find();
|
||||
if ($VideoFenLeiModel) {
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
$VideoFenLeiModel = new self;
|
||||
$VideoFenLeiModel->save($arrData);
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
if ($T->getCode() == 10501) {
|
||||
//return self::add($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
static public function getIdByName($strName)
|
||||
{
|
||||
$intId = 0;
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vj_name'] == $strName) {
|
||||
$intId = $arrFenLei['vj_id'];
|
||||
}
|
||||
}
|
||||
return $intId;
|
||||
}
|
||||
|
||||
static public function getNameById($intId)
|
||||
{
|
||||
static::getDataByCache();
|
||||
$strName = '未知';
|
||||
// var_dump(self::$arrXiaoShuoFenLei);
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vj_id'] === $intId) {
|
||||
$strName = $arrFenLei['vj_name'];
|
||||
}
|
||||
}
|
||||
return $strName;
|
||||
}
|
||||
|
||||
static public function getDataByCache()
|
||||
{
|
||||
if (self::$arrVideoShuoFenLei == []) {
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_JU_QING');
|
||||
|
||||
if (empty(self::$arrVideoShuoFenLei)) {
|
||||
self::flushCache();
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_JU_QING');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrVideoShuoFenLei;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$arrVideoShuoFenLei = self::select()->toArray();
|
||||
|
||||
Cache::tag('VIDEO_JU_QING')->set('VIDEO_JU_QING', $arrVideoShuoFenLei);
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoLeixinModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_leixin';
|
||||
protected $pk = 'vl_id';
|
||||
|
||||
static $arrVideoShuoFenLei = [];
|
||||
|
||||
static public function addVideoLeixin($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['vl_name'])) {
|
||||
throw new \Exception("类型信息不全!");
|
||||
}else{
|
||||
$VideoFenLeiModel = self::where('vl_name', $arrData['vl_name'])->where('vc_id', $arrData['vc_id'])->find();
|
||||
if ($VideoFenLeiModel) {
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
$VideoFenLeiModel = new self;
|
||||
$VideoFenLeiModel->save($arrData);
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
if ($T->getCode() == 10501) {
|
||||
//return self::addVideoLeixin($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
static public function getIdByName($strName)
|
||||
{
|
||||
$intId = 0;
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vl_name'] == $strName) {
|
||||
$intId = $arrFenLei['vl_id'];
|
||||
}
|
||||
}
|
||||
return $intId;
|
||||
}
|
||||
|
||||
static public function getNameById($intId)
|
||||
{
|
||||
static::getDataByCache();
|
||||
$strName = '未知';
|
||||
// var_dump(self::$arrXiaoShuoFenLei);
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vl_id'] === $intId) {
|
||||
$strName = $arrFenLei['vl_name'];
|
||||
}
|
||||
}
|
||||
return $strName;
|
||||
}
|
||||
|
||||
static public function getDataByCache()
|
||||
{
|
||||
if (self::$arrVideoShuoFenLei == []) {
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_LEI_XIN');
|
||||
|
||||
if (empty(self::$arrVideoShuoFenLei)) {
|
||||
self::flushCache();
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_LEI_XIN');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrVideoShuoFenLei;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$arrVideoShuoFenLei = self::select()->toArray();
|
||||
|
||||
Cache::tag('VIDEO_LEI_XIN')->set('VIDEO_LEI_XIN', $arrVideoShuoFenLei);
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoPlayurlModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_playurl';
|
||||
protected $pk = 'vp_id';
|
||||
|
||||
protected $append = [
|
||||
'http_m3u8_url',
|
||||
];
|
||||
|
||||
public function getHttpM3u8UrlAttr($value, $data)
|
||||
{
|
||||
$arrUrl = json_decode($data['vp_url'], true);
|
||||
|
||||
// $strDomain = ZiYuanDuanDianModel::getDomainByCode($arrUrl['code']);
|
||||
|
||||
// $strDomain = "https://www.123yqw.com";
|
||||
|
||||
return $arrUrl['uri'] ?? '';
|
||||
}
|
||||
|
||||
static public function add($arrData): array
|
||||
{
|
||||
try {
|
||||
// 查询是否已存在
|
||||
$XiaoShuoZhangJieModel = self::where('vp_md5', $arrData['vp_md5'])->find();
|
||||
|
||||
// 如果已存在,返回已有模型
|
||||
if ($XiaoShuoZhangJieModel) {
|
||||
return [
|
||||
'model' => $XiaoShuoZhangJieModel,
|
||||
'isNew' => false, // 已存在
|
||||
];
|
||||
}
|
||||
|
||||
// 新增数据
|
||||
$XiaoShuoZhangJieModel = new self;
|
||||
$XiaoShuoZhangJieModel->save($arrData);
|
||||
|
||||
return [
|
||||
'model' => $XiaoShuoZhangJieModel,
|
||||
'isNew' => true, // 新增
|
||||
];
|
||||
} catch (\Throwable $T) {
|
||||
var_dump($T);
|
||||
throw $T;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// static public function add($arrData): self
|
||||
// {
|
||||
|
||||
// try {
|
||||
// $XiaoShuoZhangJieModel = self::where('vp_md5', $arrData['vp_md5'])->find();
|
||||
// if ($XiaoShuoZhangJieModel) {
|
||||
// return $XiaoShuoZhangJieModel;
|
||||
// }
|
||||
|
||||
// $XiaoShuoZhangJieModel = new self;
|
||||
|
||||
// $XiaoShuoZhangJieModel->save($arrData);
|
||||
// return $XiaoShuoZhangJieModel;
|
||||
|
||||
// } catch (\Throwable $T) {
|
||||
// var_dump($T);
|
||||
// // if ($T->getCode() == 10501) {
|
||||
// // return self::add($arrData);
|
||||
// // }
|
||||
// throw $T;
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 判断章节是否存在
|
||||
*
|
||||
* @param bool $strXszjSourceCode
|
||||
* @return void
|
||||
*/
|
||||
static public function checkZhangJieExists($strXszjSourceCode)
|
||||
{
|
||||
$XiaoShuoZhangJieModel = self::where('vp_md5', $strXszjSourceCode)->find();
|
||||
return !empty($XiaoShuoZhangJieModel);
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoYearsModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_years';
|
||||
protected $pk = 'vy_id';
|
||||
|
||||
static $arrVideoShuoFenLei = [];
|
||||
|
||||
static public function add($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['vy_name'])) {
|
||||
throw new \Exception("年份信息不全!");
|
||||
}else{
|
||||
$VideoFenLeiModel = self::where('vy_name', $arrData['vy_name'])->where('vc_id', $arrData['vc_id'])->find();
|
||||
if ($VideoFenLeiModel) {
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
$VideoFenLeiModel = new self;
|
||||
$VideoFenLeiModel->save($arrData);
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
if ($T->getCode() == 10501) {
|
||||
//return self::add($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
static public function getIdByName($strName)
|
||||
{
|
||||
$intId = 0;
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vy_name'] == $strName) {
|
||||
$intId = $arrFenLei['vy_id'];
|
||||
}
|
||||
}
|
||||
return $intId;
|
||||
}
|
||||
|
||||
static public function getNameById($intId)
|
||||
{
|
||||
static::getDataByCache();
|
||||
$strName = '未知';
|
||||
// var_dump(self::$arrXiaoShuoFenLei);
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vy_id'] === $intId) {
|
||||
$strName = $arrFenLei['vy_name'];
|
||||
}
|
||||
}
|
||||
return $strName;
|
||||
}
|
||||
|
||||
static public function getDataByCache()
|
||||
{
|
||||
if (self::$arrVideoShuoFenLei == []) {
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_YEARS');
|
||||
|
||||
if (empty(self::$arrVideoShuoFenLei)) {
|
||||
self::flushCache();
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_YEARS');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrVideoShuoFenLei;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$arrVideoShuoFenLei = self::select()->toArray();
|
||||
|
||||
Cache::tag('VIDEO_YEARS')->set('VIDEO_YEARS', $arrVideoShuoFenLei);
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VideoYuyanModel extends BaseModel
|
||||
{
|
||||
protected $name = 'video_language';
|
||||
protected $pk = 'vla_id';
|
||||
|
||||
static $arrVideoShuoFenLei = [];
|
||||
|
||||
static public function add($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['vla_name'])) {
|
||||
throw new \Exception("年份信息不全!");
|
||||
}else{
|
||||
$VideoFenLeiModel = self::where('vla_name', $arrData['vla_name'])->where('vc_id', $arrData['vc_id'])->find();
|
||||
if ($VideoFenLeiModel) {
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
$VideoFenLeiModel = new self;
|
||||
$VideoFenLeiModel->save($arrData);
|
||||
return $VideoFenLeiModel;
|
||||
}
|
||||
|
||||
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
if ($T->getCode() == 10501) {
|
||||
//return self::add($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
static public function getIdByName($strName)
|
||||
{
|
||||
$intId = 0;
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vla_name'] == $strName) {
|
||||
$intId = $arrFenLei['vla_id'];
|
||||
}
|
||||
}
|
||||
return $intId;
|
||||
}
|
||||
|
||||
static public function getNameById($intId)
|
||||
{
|
||||
static::getDataByCache();
|
||||
$strName = '未知';
|
||||
// var_dump(self::$arrXiaoShuoFenLei);
|
||||
foreach (self::$arrVideoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['vla_id'] === $intId) {
|
||||
$strName = $arrFenLei['vla_name'];
|
||||
}
|
||||
}
|
||||
return $strName;
|
||||
}
|
||||
|
||||
static public function getDataByCache()
|
||||
{
|
||||
if (self::$arrVideoShuoFenLei == []) {
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_YUYAN');
|
||||
|
||||
if (empty(self::$arrVideoShuoFenLei)) {
|
||||
self::flushCache();
|
||||
self::$arrVideoShuoFenLei = Cache::get('VIDEO_YUYAN');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrVideoShuoFenLei;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$arrVideoShuoFenLei = self::select()->toArray();
|
||||
|
||||
Cache::tag('VIDEO_YUYAN')->set('VIDEO_YUYAN', $arrVideoShuoFenLei);
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class VisitLogsModel extends BaseModel
|
||||
{
|
||||
protected $name = 'visit_logs';
|
||||
protected $pk = 'vil_id';
|
||||
|
||||
static public function add(array $arrData): self
|
||||
{
|
||||
// 处理数据,避免 undefined index 问题
|
||||
$arrData = [
|
||||
'vil_ip' => $arrData['vil_ip'] ?? '',
|
||||
'vil_user_agent' => $arrData['vil_user_agent'] ?? '',
|
||||
'vil_url' => $arrData['vil_url'] ?? '',
|
||||
'vil_method' => $arrData['vil_method'] ?? '',
|
||||
'vil_headers' => $arrData['vil_headers'] ?? '',
|
||||
'vil_timestamp' => date('Y-m-d H:i:s'),
|
||||
'vil_content_type' => $arrData['vil_content_type'] ?? '',
|
||||
'vil_content_id' => $arrData['vil_content_id'] ?? '',
|
||||
'vil_is_spider' => $arrData['vil_is_spider'] ?? '',
|
||||
'vil_location' => $arrData['vil_location'] ?? '',
|
||||
];
|
||||
|
||||
try {
|
||||
// 必填字段校验
|
||||
$requiredFields = ['vil_ip', 'vil_url', 'vil_content_id', 'vil_content_type', 'vil_method'];
|
||||
foreach ($requiredFields as $field) {
|
||||
if (empty($arrData[$field])) {
|
||||
var_dump('字段缺失: {}'.$field);
|
||||
// throw new \InvalidArgumentException("字段缺失: {$field}");
|
||||
}
|
||||
}
|
||||
|
||||
// 创建模型实例
|
||||
$visitLogModel = new self;
|
||||
|
||||
// 保存数据
|
||||
if (!$visitLogModel::create($arrData)) {
|
||||
var_dump('保存失败: ');
|
||||
// throw new \RuntimeException('访问日志保存失败: ' . json_encode($arrData, JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
return $visitLogModel;
|
||||
} catch (\Throwable $T) {
|
||||
// 如果错误码是 10501,可以在这里做特殊处理
|
||||
if ($T->getCode() == 10501) {
|
||||
// 记录日志或进行备用操作
|
||||
// logError($T->getMessage());
|
||||
}
|
||||
|
||||
throw $T; // 继续抛出异常
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class XiaoShuoFenLeiModel extends BaseModel
|
||||
{
|
||||
protected $name = 'xiao_shuo_fen_lei';
|
||||
protected $pk = 'xsfl_id';
|
||||
|
||||
static $arrXiaoShuoFenLei = [];
|
||||
|
||||
static public function addXiaoShuoFenLei($arrData): self
|
||||
{
|
||||
try {
|
||||
if (empty($arrData['xsfl_name']) || empty($arrData['xsfl_source_id'])) {
|
||||
throw new \Exception("小说分类信息不全!");
|
||||
}
|
||||
|
||||
$XiaoShuoFenLeiModel = self::where('xsfl_name', $arrData['xsfl_name'])->find();
|
||||
if ($XiaoShuoFenLeiModel) {
|
||||
return $XiaoShuoFenLeiModel;
|
||||
}
|
||||
|
||||
$XiaoShuoFenLeiModel = new self;
|
||||
$XiaoShuoFenLeiModel->xsfl_source_id = $arrData['xsfl_source_id'];
|
||||
$XiaoShuoFenLeiModel->xsfl_source_code = $arrData['xsfl_source_code'];
|
||||
$XiaoShuoFenLeiModel->xsfl_name = $arrData['xsfl_name'];
|
||||
$XiaoShuoFenLeiModel->save();
|
||||
return $XiaoShuoFenLeiModel;
|
||||
} catch (\Throwable $T) {
|
||||
|
||||
if ($T->getCode() == 10501) {
|
||||
return self::addXiaoShuoFenLei($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
static public function getIdByName($strName)
|
||||
{
|
||||
$intId = 0;
|
||||
foreach (self::$arrXiaoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['xsfl_name'] == $strName && $arrFenLei['site_id'] == config('app.default_app_id')) {
|
||||
$intId = $arrFenLei['xsfl_id'];
|
||||
}
|
||||
}
|
||||
return $intId;
|
||||
}
|
||||
|
||||
static public function getNameById($intId)
|
||||
{
|
||||
static::getDataByCache();
|
||||
$strName = '全部';
|
||||
foreach (self::$arrXiaoShuoFenLei as $arrFenLei) {
|
||||
if ($arrFenLei['xsfl_source_id'] == $intId && $arrFenLei['site_id'] == config('app.default_app_id')) {
|
||||
$strName = $arrFenLei['xsfl_name'];
|
||||
}
|
||||
}
|
||||
return $strName;
|
||||
}
|
||||
|
||||
static public function getDataByCache()
|
||||
{
|
||||
$strCacheKey = 'XIAO_SHUO_FEN_LEI';
|
||||
if (self::$arrXiaoShuoFenLei == []) {
|
||||
self::$arrXiaoShuoFenLei = Cache::get( $strCacheKey);
|
||||
|
||||
if (empty(self::$arrXiaoShuoFenLei)) {
|
||||
self::flushCache();
|
||||
self::$arrXiaoShuoFenLei = Cache::get( $strCacheKey);
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrXiaoShuoFenLei;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$strCacheKey = 'XIAO_SHUO_FEN_LEI';
|
||||
$arrXiaoShuoFenLei = self::where('site_id',config('app.default_app_id'))->select()->toArray();
|
||||
|
||||
Cache::tag( $strCacheKey)->set( $strCacheKey, $arrXiaoShuoFenLei);
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class XiaoShuoXiangQingModel extends BaseModel
|
||||
{
|
||||
protected $name = 'xiao_shuo_xiang_qing';
|
||||
protected $pk = 'xsxq_id';
|
||||
|
||||
protected $append = [
|
||||
'xsxq_feng_mian_url',
|
||||
'xsfl_name',
|
||||
];
|
||||
|
||||
public function getXsxqFengMianUrlAttr($value, $data)
|
||||
{
|
||||
if(!empty($data['xsxq_feng_mian'])){
|
||||
$arrUrl = json_decode($data['xsxq_feng_mian'], true);
|
||||
|
||||
$strDomain = ZiYuanDuanDianModel::getDomainByCode($arrUrl['code']);
|
||||
|
||||
return $strDomain . $arrUrl['uri'];
|
||||
}
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
public function getXsxqTagAttr($value, $data)
|
||||
{
|
||||
return json_decode($data['xsxq_tag'], true);
|
||||
}
|
||||
|
||||
public function getXsflNameAttr($value, $data)
|
||||
{
|
||||
$strXiaoShuoFenLeiName = '';
|
||||
if(!empty($data['xsfl_id'])){
|
||||
$strXiaoShuoFenLeiName = XiaoShuoFenLeiModel::getNameById($data['xsfl_id']);
|
||||
|
||||
}
|
||||
|
||||
return $strXiaoShuoFenLeiName;
|
||||
}
|
||||
|
||||
static public function addXiaoShuoXiangQing($arrData): self
|
||||
{
|
||||
|
||||
try {
|
||||
$XiaoShuoXiangQingModel = self::where('xsxq_source_code', $arrData['xsxq_source_code'])->find();
|
||||
|
||||
if ($XiaoShuoXiangQingModel) {
|
||||
|
||||
if ($XiaoShuoXiangQingModel->xsxq_geng_xin_shi_jian != $arrData['xsxq_geng_xin_shi_jian']) {
|
||||
$XiaoShuoXiangQingModel->xsxq_geng_xin_shi_jian = $arrData['xsxq_geng_xin_shi_jian'];
|
||||
$XiaoShuoXiangQingModel->xsxq_zuozhe = $arrData['xsxq_zuozhe'];
|
||||
$XiaoShuoXiangQingModel->save();
|
||||
}
|
||||
|
||||
return $XiaoShuoXiangQingModel;
|
||||
}
|
||||
|
||||
$XiaoShuoXiangQingModel = new self;
|
||||
|
||||
$XiaoShuoXiangQingModel->save($arrData);
|
||||
return $XiaoShuoXiangQingModel;
|
||||
} catch (\Throwable $T) {
|
||||
// if ($T->getCode() == 10501 && $retryCount < 3) { // 限制重试次数
|
||||
// $retryCount++;
|
||||
// return self::addXiaoShuoXiangQing($arrData, $retryCount);
|
||||
// }
|
||||
throw $T; // 超过重试次数后抛出异常
|
||||
// if ($T->getCode() == 10501) {
|
||||
// return self::addXiaoShuoXiangQing($arrData);
|
||||
// }
|
||||
// throw $T;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class XiaoShuoZhangJieModel extends BaseModel
|
||||
{
|
||||
protected $name = 'xiao_shuo_zhang_jie';
|
||||
protected $pk = 'xszj_id';
|
||||
|
||||
static public function addXiaoShuoZhangJie($arrData): self
|
||||
{
|
||||
try {
|
||||
$XiaoShuoZhangJieModel = self::where('xszj_source_code', $arrData['xszj_source_code'])->find();
|
||||
if ($XiaoShuoZhangJieModel) {
|
||||
return $XiaoShuoZhangJieModel;
|
||||
}
|
||||
|
||||
$XiaoShuoZhangJieModel = new self;
|
||||
|
||||
$XiaoShuoZhangJieModel->save($arrData);
|
||||
return $XiaoShuoZhangJieModel;
|
||||
} catch (\Throwable $T) {
|
||||
if ($T->getCode() == 10501) {
|
||||
return self::addXiaoShuoZhangJie($arrData);
|
||||
}
|
||||
throw $T;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断章节是否存在
|
||||
*
|
||||
* @param bool $strXszjSourceCode
|
||||
* @return void
|
||||
*/
|
||||
static public function checkZhangJieExists($strXszjSourceCode)
|
||||
{
|
||||
$XiaoShuoZhangJieModel = self::where('xszj_source_code', $strXszjSourceCode)->find();
|
||||
return !empty($XiaoShuoZhangJieModel);
|
||||
}
|
||||
}
|
||||
97
code/app/home/BaseController.php
Normal file
97
code/app/home/BaseController.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\home;
|
||||
|
||||
use think\App;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\View;
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 控制器基础类
|
||||
*/
|
||||
abstract class BaseController
|
||||
{
|
||||
/**
|
||||
* Request实例
|
||||
* @var \think\Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* 应用实例
|
||||
* @var \think\App
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* 是否批量验证
|
||||
* @var bool
|
||||
*/
|
||||
protected $batchValidate = false;
|
||||
|
||||
/**
|
||||
* 控制器中间件
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [];
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @access public
|
||||
* @param App $app 应用对象
|
||||
*/
|
||||
public function __construct(App $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->request = $this->app->request;
|
||||
|
||||
// 控制器初始化
|
||||
$this->initialize();
|
||||
|
||||
// View::assign('')
|
||||
}
|
||||
|
||||
// 初始化
|
||||
protected function initialize()
|
||||
{}
|
||||
|
||||
/**
|
||||
* 验证数据
|
||||
* @access protected
|
||||
* @param array $data 数据
|
||||
* @param string|array $validate 验证器名或者验证规则数组
|
||||
* @param array $message 提示信息
|
||||
* @param bool $batch 是否批量验证
|
||||
* @return array|string|true
|
||||
* @throws ValidateException
|
||||
*/
|
||||
protected function validate(array $data, string|array $validate, array $message = [], bool $batch = false)
|
||||
{
|
||||
if (is_array($validate)) {
|
||||
$v = new Validate();
|
||||
$v->rule($validate);
|
||||
} else {
|
||||
if (strpos($validate, '.')) {
|
||||
// 支持场景
|
||||
[$validate, $scene] = explode('.', $validate);
|
||||
}
|
||||
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
|
||||
$v = new $class();
|
||||
if (!empty($scene)) {
|
||||
$v->scene($scene);
|
||||
}
|
||||
}
|
||||
|
||||
$v->message($message);
|
||||
|
||||
// 是否批量验证
|
||||
if ($batch || $this->batchValidate) {
|
||||
$v->batch(true);
|
||||
}
|
||||
|
||||
return $v->failException(true)->check($data);
|
||||
}
|
||||
|
||||
}
|
||||
5
code/app/home/config/view.php
Normal file
5
code/app/home/config/view.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
use app\model\AutoSwitchViewModel;
|
||||
|
||||
return AutoSwitchViewModel::getViewConfig();
|
||||
@@ -1,17 +1,37 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\home\controller;
|
||||
|
||||
class Index
|
||||
use app\home\BaseController;
|
||||
use storage\StorageCore;
|
||||
use think\facade\View;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$arrConfig = config();
|
||||
echo '<pre>';
|
||||
print_r($arrConfig);
|
||||
echo '</pre>';
|
||||
// exit;
|
||||
return '您好!这是一个[home]示例应用';
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
|
||||
$strNovelKey = "novels/12/chapters/3001.txt";
|
||||
$StorageCore = StorageCore::getInstance();
|
||||
|
||||
// $content = '我是一个大傻逼';
|
||||
|
||||
$content = file_get_contents('123.txt');
|
||||
|
||||
if ($StorageCore->has($strNovelKey)) {
|
||||
// $MinIO->update($strNovelKey, $content); // 更新已有文件
|
||||
} else {
|
||||
$StorageCore->write($strNovelKey, $content); // 创建新文件
|
||||
}
|
||||
|
||||
echo $StorageCore->read($strNovelKey);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
17
code/app/home/controller/Novel.php
Normal file
17
code/app/home/controller/Novel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\home\controller;
|
||||
|
||||
use app\home\BaseController;
|
||||
use storage\StorageCore;
|
||||
use think\facade\View;
|
||||
|
||||
class Novel extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return View::fetch();
|
||||
}
|
||||
}
|
||||
1
code/app/home/view/default/Index/index.html
Normal file
1
code/app/home/view/default/Index/index.html
Normal file
@@ -0,0 +1 @@
|
||||
12312321
|
||||
1
code/app/home/view/default/Novel/index.html
Normal file
1
code/app/home/view/default/Novel/index.html
Normal file
@@ -0,0 +1 @@
|
||||
12312321
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
use think\facade\Cache;
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
33
code/app/model/AutoSwitchViewModel.php
Normal file
33
code/app/model/AutoSwitchViewModel.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Request;
|
||||
|
||||
class AutoSwitchViewModel
|
||||
{
|
||||
static public function getViewConfig(): array
|
||||
{
|
||||
$Request = request();
|
||||
|
||||
$strDomain = $Request->rootDomain();
|
||||
|
||||
$DomainModel = DomainModel::getDomainByCache($strDomain);
|
||||
|
||||
$TemplatesModel = TemplatesModel::getValByCode($DomainModel->t_id);
|
||||
|
||||
$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),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
30
code/app/model/DomainModel.php
Normal file
30
code/app/model/DomainModel.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class DomainModel extends BaseModel
|
||||
{
|
||||
protected $name = 'domain';
|
||||
protected $pk = 'd_id';
|
||||
|
||||
|
||||
static public function getDomainByCache($strDomain)
|
||||
{
|
||||
$strKey = "D:" . $strDomain;
|
||||
return DomainModel::where('d_domain', $strDomain)->cache($strKey, 24 * 3600)->find();
|
||||
}
|
||||
|
||||
static public function flushDomainCache($strDomain)
|
||||
{
|
||||
$strKey = "D:" . $strDomain;
|
||||
return Cache::delete($strKey);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
42
code/app/model/TemplatesModel.php
Normal file
42
code/app/model/TemplatesModel.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class TemplatesModel extends BaseModel
|
||||
{
|
||||
protected $name = 'templates';
|
||||
protected $pk = 't_id';
|
||||
|
||||
static $arrTemplates = [];
|
||||
|
||||
static public function getValByCode($intTId)
|
||||
{
|
||||
if (self::$arrTemplates == []) {
|
||||
self::$arrTemplates = Cache::get('Templates');
|
||||
|
||||
if (empty(self::$arrTemplates)) {
|
||||
self::flushCache();
|
||||
self::$arrTemplates = Cache::get('Templates');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$arrTemplates[$intTId] ?? NULL;
|
||||
}
|
||||
|
||||
static public function flushCache()
|
||||
{
|
||||
$TemplatesModelAll = self::select();
|
||||
|
||||
$TemplatesCol = $TemplatesModelAll->column(null, 't_id');
|
||||
|
||||
Cache::tag('Templates')->set('Templates', $TemplatesCol);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\model;
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
@@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\task\collection;
|
||||
|
||||
use app\admin\model\CaiJiPeiZhiModel;
|
||||
use app\admin\model\SystemConfigModel;
|
||||
use app\model\CaiJiPeiZhiModel;
|
||||
use app\model\SystemConfigModel;
|
||||
use app\task\core\TaskCore;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ declare(strict_types=1);
|
||||
namespace app\task\collection\biquxs;
|
||||
|
||||
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -5,9 +5,9 @@ declare(strict_types=1);
|
||||
namespace app\task\collection\ccc5;
|
||||
|
||||
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -4,15 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\task\collection\dadi;
|
||||
|
||||
use app\admin\model\VideoPlayurlModel;
|
||||
use app\admin\model\VideoLeixinModel;
|
||||
use app\admin\model\VideoDiquModel;
|
||||
use app\admin\model\VideoYearsModel;
|
||||
use app\admin\model\VideoJuqingModel;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\VideoInfoModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\VideoPlayurlModel;
|
||||
use app\model\VideoLeixinModel;
|
||||
use app\model\VideoDiquModel;
|
||||
use app\model\VideoYearsModel;
|
||||
use app\model\VideoJuqingModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\VideoInfoModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -4,15 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\task\collection\heimuer;
|
||||
|
||||
use app\admin\model\VideoPlayurlModel;
|
||||
use app\admin\model\VideoLeixinModel;
|
||||
use app\admin\model\VideoDiquModel;
|
||||
use app\admin\model\VideoYearsModel;
|
||||
use app\admin\model\VideoJuqingModel;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\VideoInfoModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\VideoPlayurlModel;
|
||||
use app\model\VideoLeixinModel;
|
||||
use app\model\VideoDiquModel;
|
||||
use app\model\VideoYearsModel;
|
||||
use app\model\VideoJuqingModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\VideoInfoModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -5,10 +5,10 @@ declare(strict_types=1);
|
||||
namespace app\task\collection\novel;
|
||||
|
||||
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\admin\model\NovelInfoSeoModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\model\NovelInfoSeoModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
||||
namespace app\task\collection\novelone;
|
||||
|
||||
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
||||
namespace app\task\collection\novelone;
|
||||
|
||||
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace app\task\collection\seo;
|
||||
|
||||
use app\task\collection\PullDataColBase;
|
||||
|
||||
use app\admin\model\VideoInfoModel;
|
||||
use app\admin\model\SystemConfigModel;
|
||||
use app\admin\model\VideoClassModel;
|
||||
use app\model\VideoInfoModel;
|
||||
use app\model\SystemConfigModel;
|
||||
use app\model\VideoClassModel;
|
||||
|
||||
class GenerateSiteMapCol extends PullDataColBase
|
||||
{
|
||||
|
||||
@@ -6,11 +6,11 @@ namespace app\task\collection\seo;
|
||||
|
||||
use app\task\collection\PullDataColBase;
|
||||
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\admin\model\SystemConfigModel;
|
||||
use app\admin\model\SiteModel;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\model\SystemConfigModel;
|
||||
use app\model\SiteModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
|
||||
class GenerateSiteMapNovel extends PullDataColBase
|
||||
{
|
||||
|
||||
@@ -6,11 +6,11 @@ namespace app\task\collection\seo;
|
||||
|
||||
use app\task\collection\PullDataColBase;
|
||||
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\NovelInfoSeoModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\admin\model\SiteModel;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\NovelInfoSeoModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\model\SiteModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
|
||||
class GenerateSiteMapNovelSk extends PullDataColBase
|
||||
{
|
||||
|
||||
@@ -6,11 +6,11 @@ namespace app\task\collection\seo;
|
||||
|
||||
use app\task\collection\PullDataColBase;
|
||||
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\NovelInfoSeoModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\admin\model\SiteModel;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\NovelInfoSeoModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\model\SiteModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
|
||||
class GenerateSiteMapNovelZw extends PullDataColBase
|
||||
{
|
||||
|
||||
@@ -5,9 +5,9 @@ declare(strict_types=1);
|
||||
namespace app\task\collection\tianlai;
|
||||
|
||||
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -5,16 +5,16 @@ declare(strict_types=1);
|
||||
namespace app\task\collection\visitlogs;
|
||||
|
||||
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
use think\facade\Cache;
|
||||
use QL\QueryList;
|
||||
use app\admin\model\VisitLogsModel;
|
||||
use app\admin\model\ContentStatsModel;
|
||||
use app\model\VisitLogsModel;
|
||||
use app\model\ContentStatsModel;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
|
||||
@@ -5,15 +5,15 @@ declare(strict_types=1);
|
||||
namespace app\task\collection\visitlogs;
|
||||
|
||||
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
use think\facade\Cache;
|
||||
use QL\QueryList;
|
||||
use app\admin\model\VisitLogsModel;
|
||||
use app\model\VisitLogsModel;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
|
||||
@@ -4,16 +4,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\task\collection\yzzy;
|
||||
|
||||
use app\admin\model\VideoYuyanModel;
|
||||
use app\admin\model\VideoPlayurlModel;
|
||||
use app\admin\model\VideoLeixinModel;
|
||||
use app\admin\model\VideoDiquModel;
|
||||
use app\admin\model\VideoYearsModel;
|
||||
use app\admin\model\VideoJuqingModel;
|
||||
use app\admin\model\XiaoShuoFenLeiModel;
|
||||
use app\admin\model\XiaoShuoXiangQingModel;
|
||||
use app\admin\model\VideoInfoModel;
|
||||
use app\admin\model\XiaoShuoZhangJieModel;
|
||||
use app\model\VideoYuyanModel;
|
||||
use app\model\VideoPlayurlModel;
|
||||
use app\model\VideoLeixinModel;
|
||||
use app\model\VideoDiquModel;
|
||||
use app\model\VideoYearsModel;
|
||||
use app\model\VideoJuqingModel;
|
||||
use app\model\XiaoShuoFenLeiModel;
|
||||
use app\model\XiaoShuoXiangQingModel;
|
||||
use app\model\VideoInfoModel;
|
||||
use app\model\XiaoShuoZhangJieModel;
|
||||
use app\task\collection\PullDataColBase;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use processor\ImageProcessor;
|
||||
|
||||
@@ -4,9 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\task\logic;
|
||||
|
||||
use app\admin\model\GuangGaoFenZuModel;
|
||||
use app\admin\model\GuangGaoModel;
|
||||
use app\admin\model\GuangGaoPeiZhiModel;
|
||||
use app\model\GuangGaoFenZuModel;
|
||||
use app\model\GuangGaoModel;
|
||||
use app\model\GuangGaoPeiZhiModel;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\task\module;
|
||||
|
||||
use app\admin\model\PlanTaskModel;
|
||||
use app\model\PlanTaskModel;
|
||||
use app\task\collection\ailisi\XiaoShuoCol;
|
||||
use app\task\collection\biquxs\BiquxsXiaoShuoCol;
|
||||
use app\task\collection\ccc5\XiaoShuo5cccCol;
|
||||
|
||||
Reference in New Issue
Block a user