From 526d3f47f4f17de2df701c0523fca3516164e490 Mon Sep 17 00:00:00 2001 From: Default Date: Tue, 18 Mar 2025 22:51:45 +0800 Subject: [PATCH] init --- code/.example.env | 44 ++- code/app/admin/AdminServiceProvider.php | 2 +- code/app/admin/controller/AdminUser.php | 2 +- code/app/admin/controller/GuangGao.php | 14 +- code/app/admin/controller/Guest.php | 2 +- code/app/admin/controller/SeoKeywords.php | 154 --------- code/app/admin/controller/SystemConfig.php | 20 +- code/app/admin/controller/XiaoShuo.php | 179 ---------- code/app/admin/middleware/AdminAuth.php | 2 +- code/app/admin/middleware/AdminCors.php | 2 +- code/app/admin/model/ContentStatsModel.php | 70 ---- code/app/admin/model/GanRaoMaModel.php | 76 ----- code/app/admin/model/GuangGaoFenZuModel.php | 17 - code/app/admin/model/GuangGaoModel.php | 59 ---- code/app/admin/model/GuangGaoPeiZhiModel.php | 40 --- code/app/admin/model/NovelInfoSeoModel.php | 41 --- code/app/admin/model/ReSouFenZuModel.php | 42 --- code/app/admin/model/ReSouModel.php | 101 ------ code/app/admin/model/SeoHtmlModel.php | 63 ---- code/app/admin/model/SeoKeywordsModel.php | 63 ---- code/app/admin/model/SeoTdkConfigModel.php | 63 ---- code/app/admin/model/SiteModel.php | 82 ----- code/app/admin/model/VideoClassModel.php | 112 ------ code/app/admin/model/VideoDiquModel.php | 90 ----- code/app/admin/model/VideoInfoModel.php | 119 ------- code/app/admin/model/VideoInfoSeoModel.php | 41 --- code/app/admin/model/VideoJuqingModel.php | 90 ----- code/app/admin/model/VideoLeixinModel.php | 90 ----- code/app/admin/model/VideoPlayurlModel.php | 96 ------ code/app/admin/model/VideoYearsModel.php | 90 ----- code/app/admin/model/VideoYuyanModel.php | 90 ----- code/app/admin/model/VisitLogsModel.php | 63 ---- code/app/admin/model/XiaoShuoFenLeiModel.php | 92 ----- .../admin/model/XiaoShuoXiangQingModel.php | 86 ----- .../app/admin/model/XiaoShuoZhangJieModel.php | 49 --- code/app/home/BaseController.php | 97 ++++++ code/app/home/config/view.php | 5 + code/app/home/controller/Index.php | 36 +- code/app/home/controller/Novel.php | 17 + code/app/home/view/default/Index/index.html | 1 + code/app/home/view/default/Novel/index.html | 1 + code/app/{admin => }/model/AdminNodeModel.php | 2 +- code/app/{admin => }/model/AdminRoleModel.php | 2 +- .../{admin => }/model/AdminRoleNodeModel.php | 2 +- code/app/{admin => }/model/AdminUserModel.php | 2 +- code/app/model/AutoSwitchViewModel.php | 33 ++ code/app/{admin => }/model/BaseModel.php | 2 +- .../{admin => }/model/CaiJiPeiZhiModel.php | 2 +- code/app/model/DomainModel.php | 30 ++ code/app/{admin => }/model/FenLeiModel.php | 2 +- code/app/{admin => }/model/PlanTaskModel.php | 2 +- .../{admin => }/model/SystemConfigModel.php | 2 +- code/app/model/TemplatesModel.php | 42 +++ .../{admin => }/model/ZiYuanDuanDianModel.php | 2 +- code/app/task/collection/PullDataColBase.php | 4 +- .../collection/biquxs/BiquxsXiaoShuoCol.php | 6 +- .../task/collection/ccc5/XiaoShuo5cccCol.php | 6 +- .../task/collection/dadi/DaDiDianyingCol.php | 18 +- .../collection/heimuer/HeiMuErYingShiCol.php | 18 +- .../collection/novel/Zw630XiaoShuoCol.php | 8 +- .../novelone/NovelJiuYuFanXianCol.php | 4 +- .../novelone/NovelWenXueGuanCol.php | 4 +- .../collection/seo/GenerateSiteMapCol.php | 6 +- .../collection/seo/GenerateSiteMapNovel.php | 10 +- .../collection/seo/GenerateSiteMapNovelSk.php | 10 +- .../collection/seo/GenerateSiteMapNovelZw.php | 10 +- .../collection/tianlai/TianLaiXiaoShuoCol.php | 6 +- .../collection/visitlogs/ContentStatsCol.php | 10 +- .../collection/visitlogs/VisitLogsCol.php | 8 +- .../task/collection/yzzy/YouZhiYingShiCol.php | 20 +- code/app/task/logic/AdTask.php | 6 +- code/app/task/module/PlanTask.php | 2 +- code/composer.json | 9 +- code/config/app.php | 19 +- code/config/storage.php | 24 ++ ...add_gg_pai_xu_colum_on_guang_gao_table.php | 20 +- .../20240809204922_seo_keywords_table.php | 46 --- .../20240924114816_guanggao_add_status.php | 20 -- .../migrations/20250104155836_video_class.php | 65 ---- .../20250104160751_video_leixin.php | 65 ---- .../20250104161057_video_juqing.php | 58 ---- .../migrations/20250104161633_video_diqu.php | 59 ---- .../migrations/20250104161642_video_years.php | 58 ---- .../20250104161650_video_language.php | 59 ---- .../migrations/20250104162037_video_info.php | 91 ----- .../20250104162430_video_playurl.php | 68 ---- .../migrations/20250105042300_gan_rao_ma.php | 62 ---- .../20250108092206_seo_tdk_config.php | 48 --- .../20250110025821_create_visit_logs.php | 56 --- .../20250110065748_create_content_stats.php | 87 ----- ...212095020_add_new_column_to_video_info.php | 41 --- .../migrations/20250215153113_seo_html.php | 48 --- ...155929_create_xiao_shuo_xiang_qing_seo.php | 54 --- ..._add_new_column_to_xiao_shuo_zhang_jie.php | 56 --- .../20250223165039_create_video_info_seo.php | 54 --- .../migrations/20250223165052_create_site.php | 56 --- ...65158_add_clouma_to_all_table_add_site.php | 57 ---- ...031014_add_cloumn_to_xiao_shuo_fen_lei.php | 34 -- code/database/seeders/PlanTaskSeeder.php | 95 +----- code/database/seeders/VideoInfoSeeder.php | 318 ------------------ code/database/seeders/VideoSeoSeeder.php | 35 -- code/extend/SeoTdkHelper.php | 37 -- code/extend/storage/StorageCore.php | 84 +++++ 103 files changed, 542 insertions(+), 4025 deletions(-) delete mode 100644 code/app/admin/controller/SeoKeywords.php delete mode 100644 code/app/admin/controller/XiaoShuo.php delete mode 100644 code/app/admin/model/ContentStatsModel.php delete mode 100644 code/app/admin/model/GanRaoMaModel.php delete mode 100644 code/app/admin/model/GuangGaoFenZuModel.php delete mode 100644 code/app/admin/model/GuangGaoModel.php delete mode 100644 code/app/admin/model/GuangGaoPeiZhiModel.php delete mode 100644 code/app/admin/model/NovelInfoSeoModel.php delete mode 100644 code/app/admin/model/ReSouFenZuModel.php delete mode 100644 code/app/admin/model/ReSouModel.php delete mode 100644 code/app/admin/model/SeoHtmlModel.php delete mode 100644 code/app/admin/model/SeoKeywordsModel.php delete mode 100644 code/app/admin/model/SeoTdkConfigModel.php delete mode 100644 code/app/admin/model/SiteModel.php delete mode 100644 code/app/admin/model/VideoClassModel.php delete mode 100644 code/app/admin/model/VideoDiquModel.php delete mode 100644 code/app/admin/model/VideoInfoModel.php delete mode 100644 code/app/admin/model/VideoInfoSeoModel.php delete mode 100644 code/app/admin/model/VideoJuqingModel.php delete mode 100644 code/app/admin/model/VideoLeixinModel.php delete mode 100644 code/app/admin/model/VideoPlayurlModel.php delete mode 100644 code/app/admin/model/VideoYearsModel.php delete mode 100644 code/app/admin/model/VideoYuyanModel.php delete mode 100644 code/app/admin/model/VisitLogsModel.php delete mode 100644 code/app/admin/model/XiaoShuoFenLeiModel.php delete mode 100644 code/app/admin/model/XiaoShuoXiangQingModel.php delete mode 100644 code/app/admin/model/XiaoShuoZhangJieModel.php create mode 100644 code/app/home/BaseController.php create mode 100644 code/app/home/config/view.php create mode 100644 code/app/home/controller/Novel.php create mode 100644 code/app/home/view/default/Index/index.html create mode 100644 code/app/home/view/default/Novel/index.html rename code/app/{admin => }/model/AdminNodeModel.php (87%) rename code/app/{admin => }/model/AdminRoleModel.php (97%) rename code/app/{admin => }/model/AdminRoleNodeModel.php (88%) rename code/app/{admin => }/model/AdminUserModel.php (98%) create mode 100644 code/app/model/AutoSwitchViewModel.php rename code/app/{admin => }/model/BaseModel.php (91%) rename code/app/{admin => }/model/CaiJiPeiZhiModel.php (96%) create mode 100644 code/app/model/DomainModel.php rename code/app/{admin => }/model/FenLeiModel.php (99%) rename code/app/{admin => }/model/PlanTaskModel.php (88%) rename code/app/{admin => }/model/SystemConfigModel.php (96%) create mode 100644 code/app/model/TemplatesModel.php rename code/app/{admin => }/model/ZiYuanDuanDianModel.php (96%) create mode 100644 code/config/storage.php delete mode 100644 code/database/migrations/20240809204922_seo_keywords_table.php delete mode 100644 code/database/migrations/20240924114816_guanggao_add_status.php delete mode 100644 code/database/migrations/20250104155836_video_class.php delete mode 100644 code/database/migrations/20250104160751_video_leixin.php delete mode 100644 code/database/migrations/20250104161057_video_juqing.php delete mode 100644 code/database/migrations/20250104161633_video_diqu.php delete mode 100644 code/database/migrations/20250104161642_video_years.php delete mode 100644 code/database/migrations/20250104161650_video_language.php delete mode 100644 code/database/migrations/20250104162037_video_info.php delete mode 100644 code/database/migrations/20250104162430_video_playurl.php delete mode 100644 code/database/migrations/20250105042300_gan_rao_ma.php delete mode 100644 code/database/migrations/20250108092206_seo_tdk_config.php delete mode 100644 code/database/migrations/20250110025821_create_visit_logs.php delete mode 100644 code/database/migrations/20250110065748_create_content_stats.php delete mode 100644 code/database/migrations/20250212095020_add_new_column_to_video_info.php delete mode 100644 code/database/migrations/20250215153113_seo_html.php delete mode 100644 code/database/migrations/20250219155929_create_xiao_shuo_xiang_qing_seo.php delete mode 100644 code/database/migrations/20250221094510_add_new_column_to_xiao_shuo_zhang_jie.php delete mode 100644 code/database/migrations/20250223165039_create_video_info_seo.php delete mode 100644 code/database/migrations/20250223165052_create_site.php delete mode 100644 code/database/migrations/20250223165158_add_clouma_to_all_table_add_site.php delete mode 100644 code/database/migrations/20250224031014_add_cloumn_to_xiao_shuo_fen_lei.php delete mode 100644 code/database/seeders/VideoInfoSeeder.php delete mode 100644 code/database/seeders/VideoSeoSeeder.php delete mode 100644 code/extend/SeoTdkHelper.php create mode 100644 code/extend/storage/StorageCore.php diff --git a/code/.example.env b/code/.example.env index 3a7919e..9d54ea7 100644 --- a/code/.example.env +++ b/code/.example.env @@ -1,21 +1,47 @@ -[APP] +# 应用 APP_DEBUG = true SHOW_ERROR_MSG = true +DEFAULT_LANG = zh-cn +DEFAULT_ -[DB] +# 数据库 DB_TYPE = mysql DB_HOST = 127.0.0.1 -DB_NAME = test -DB_USER = username -DB_PASS = password +DB_NAME = seo +DB_USER = root +DB_PASS = qq123123 DB_PORT = 3306 DB_CHARSET = utf8mb4 DB_SQL_DEBUG = true DB_FIELD_CACHE = false -[CACHE] +# 缓存 +CACHE_DRIVER = redis +CACHE_TIME = 7200 -[TASK] +# REDIS +REDIS_HOST = 127.0.0.1 +REDIS_PORT = 6379 +REDIS_PASSWORD = +REDIS_PREFIX = +REDIS_DATABASE = 0 -[LANG] -DEFAULT_LANG = zh-cn +# TASK +TASK_PROCESS_NUM_01 = 4 +TASK_PROCESS_NUM_02 = 2 + +# QUEUEU +QUEUE_NAME_1 = QueueKey01 +QUEUE_EXEC_NUM_1 = 10 +QUEUE_NAME_2 = QueueKey02 +QUEUE_EXEC_NUM_2 = 10 + +# MINIO +MINIO_END_POINT = http://127.0.0.1:9200 +MINIO_KEY = FeJI6i2j15TK5lNNRuN2 +MINIO_SECRET = oTr9cVCYjql4SLehde0cXcFRCaA3QLnw4Yhnjw6N +MINIO_REGION = hk-01 +MINIO_BUCKET = test001 + +# LocalStorage +STORAGE_LOCAL_DIR = /mnt/gluster diff --git a/code/app/admin/AdminServiceProvider.php b/code/app/admin/AdminServiceProvider.php index 85e6a95..a165219 100644 --- a/code/app/admin/AdminServiceProvider.php +++ b/code/app/admin/AdminServiceProvider.php @@ -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; diff --git a/code/app/admin/controller/AdminUser.php b/code/app/admin/controller/AdminUser.php index ac833f6..9177d2b 100644 --- a/code/app/admin/controller/AdminUser.php +++ b/code/app/admin/controller/AdminUser.php @@ -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; diff --git a/code/app/admin/controller/GuangGao.php b/code/app/admin/controller/GuangGao.php index 587c6a7..a2922ed 100644 --- a/code/app/admin/controller/GuangGao.php +++ b/code/app/admin/controller/GuangGao.php @@ -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; diff --git a/code/app/admin/controller/Guest.php b/code/app/admin/controller/Guest.php index 5607bdf..d59023e 100644 --- a/code/app/admin/controller/Guest.php +++ b/code/app/admin/controller/Guest.php @@ -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; diff --git a/code/app/admin/controller/SeoKeywords.php b/code/app/admin/controller/SeoKeywords.php deleted file mode 100644 index 6843385..0000000 --- a/code/app/admin/controller/SeoKeywords.php +++ /dev/null @@ -1,154 +0,0 @@ - $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(); - } - - -} diff --git a/code/app/admin/controller/SystemConfig.php b/code/app/admin/controller/SystemConfig.php index 46be312..3458771 100644 --- a/code/app/admin/controller/SystemConfig.php +++ b/code/app/admin/controller/SystemConfig.php @@ -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; diff --git a/code/app/admin/controller/XiaoShuo.php b/code/app/admin/controller/XiaoShuo.php deleted file mode 100644 index c04ce03..0000000 --- a/code/app/admin/controller/XiaoShuo.php +++ /dev/null @@ -1,179 +0,0 @@ - $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); - } -} diff --git a/code/app/admin/middleware/AdminAuth.php b/code/app/admin/middleware/AdminAuth.php index 52daa79..054298d 100644 --- a/code/app/admin/middleware/AdminAuth.php +++ b/code/app/admin/middleware/AdminAuth.php @@ -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; diff --git a/code/app/admin/middleware/AdminCors.php b/code/app/admin/middleware/AdminCors.php index 98503c5..4ee0ecf 100644 --- a/code/app/admin/middleware/AdminCors.php +++ b/code/app/admin/middleware/AdminCors.php @@ -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; diff --git a/code/app/admin/model/ContentStatsModel.php b/code/app/admin/model/ContentStatsModel.php deleted file mode 100644 index 204c06f..0000000 --- a/code/app/admin/model/ContentStatsModel.php +++ /dev/null @@ -1,70 +0,0 @@ - $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; - } - } - -} diff --git a/code/app/admin/model/GanRaoMaModel.php b/code/app/admin/model/GanRaoMaModel.php deleted file mode 100644 index 2a3324b..0000000 --- a/code/app/admin/model/GanRaoMaModel.php +++ /dev/null @@ -1,76 +0,0 @@ -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"); - } - } - } -} diff --git a/code/app/admin/model/GuangGaoFenZuModel.php b/code/app/admin/model/GuangGaoFenZuModel.php deleted file mode 100644 index 6d8d280..0000000 --- a/code/app/admin/model/GuangGaoFenZuModel.php +++ /dev/null @@ -1,17 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/GuangGaoPeiZhiModel.php b/code/app/admin/model/GuangGaoPeiZhiModel.php deleted file mode 100644 index 9bedffb..0000000 --- a/code/app/admin/model/GuangGaoPeiZhiModel.php +++ /dev/null @@ -1,40 +0,0 @@ -set('GuangGaoPeiZhi', $arrGuangGaoPeiZhi); - } -} diff --git a/code/app/admin/model/NovelInfoSeoModel.php b/code/app/admin/model/NovelInfoSeoModel.php deleted file mode 100644 index de3e2a6..0000000 --- a/code/app/admin/model/NovelInfoSeoModel.php +++ /dev/null @@ -1,41 +0,0 @@ -find(); - - if ($XiaoShuoXiangQingModel) { - - return $XiaoShuoXiangQingModel; - } - - $XiaoShuoXiangQingModel = new self; - - $XiaoShuoXiangQingModel->save($arrData); - return $XiaoShuoXiangQingModel; - } catch (\Throwable $T) { - - throw $T; // 超过重试次数后抛出异常 - - } - } -} diff --git a/code/app/admin/model/ReSouFenZuModel.php b/code/app/admin/model/ReSouFenZuModel.php deleted file mode 100644 index 6a386ce..0000000 --- a/code/app/admin/model/ReSouFenZuModel.php +++ /dev/null @@ -1,42 +0,0 @@ -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; - } - } -} diff --git a/code/app/admin/model/ReSouModel.php b/code/app/admin/model/ReSouModel.php deleted file mode 100644 index a418eb2..0000000 --- a/code/app/admin/model/ReSouModel.php +++ /dev/null @@ -1,101 +0,0 @@ -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()); - } -} diff --git a/code/app/admin/model/SeoHtmlModel.php b/code/app/admin/model/SeoHtmlModel.php deleted file mode 100644 index 0765df5..0000000 --- a/code/app/admin/model/SeoHtmlModel.php +++ /dev/null @@ -1,63 +0,0 @@ -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."); - } - } - } - -} diff --git a/code/app/admin/model/SeoKeywordsModel.php b/code/app/admin/model/SeoKeywordsModel.php deleted file mode 100644 index ff1b566..0000000 --- a/code/app/admin/model/SeoKeywordsModel.php +++ /dev/null @@ -1,63 +0,0 @@ -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."); - } - } - } - -} diff --git a/code/app/admin/model/SeoTdkConfigModel.php b/code/app/admin/model/SeoTdkConfigModel.php deleted file mode 100644 index 8ca321b..0000000 --- a/code/app/admin/model/SeoTdkConfigModel.php +++ /dev/null @@ -1,63 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/SiteModel.php b/code/app/admin/model/SiteModel.php deleted file mode 100644 index 023f030..0000000 --- a/code/app/admin/model/SiteModel.php +++ /dev/null @@ -1,82 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/VideoClassModel.php b/code/app/admin/model/VideoClassModel.php deleted file mode 100644 index d425b03..0000000 --- a/code/app/admin/model/VideoClassModel.php +++ /dev/null @@ -1,112 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/VideoDiquModel.php b/code/app/admin/model/VideoDiquModel.php deleted file mode 100644 index 47a0cb7..0000000 --- a/code/app/admin/model/VideoDiquModel.php +++ /dev/null @@ -1,90 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/VideoInfoModel.php b/code/app/admin/model/VideoInfoModel.php deleted file mode 100644 index 88debef..0000000 --- a/code/app/admin/model/VideoInfoModel.php +++ /dev/null @@ -1,119 +0,0 @@ -find(); - - if ($VideoXiangQingModel) { - - return [ - 'model' => $VideoXiangQingModel, - 'isNew' => false, // 已存在 - ]; - } - $VideoXiangQingModel = new self; - $VideoXiangQingModel->save($arrData); - return [ - 'model' => $VideoXiangQingModel, - 'isNew' => true, // 新增 - ]; - - } catch (\Throwable $T) { - - throw $T; // 超过重试次数后抛出异常 - - } - - - } - -} diff --git a/code/app/admin/model/VideoInfoSeoModel.php b/code/app/admin/model/VideoInfoSeoModel.php deleted file mode 100644 index 820333b..0000000 --- a/code/app/admin/model/VideoInfoSeoModel.php +++ /dev/null @@ -1,41 +0,0 @@ -find(); - - if ($VideoModel) { - - return $VideoModel; - } - - $VideoModel = new self; - - $VideoModel->save($arrData); - return $VideoModel; - } catch (\Throwable $T) { - - throw $T; // 超过重试次数后抛出异常 - - } - } -} diff --git a/code/app/admin/model/VideoJuqingModel.php b/code/app/admin/model/VideoJuqingModel.php deleted file mode 100644 index 810c463..0000000 --- a/code/app/admin/model/VideoJuqingModel.php +++ /dev/null @@ -1,90 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/VideoLeixinModel.php b/code/app/admin/model/VideoLeixinModel.php deleted file mode 100644 index 4af51aa..0000000 --- a/code/app/admin/model/VideoLeixinModel.php +++ /dev/null @@ -1,90 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/VideoPlayurlModel.php b/code/app/admin/model/VideoPlayurlModel.php deleted file mode 100644 index 7347d55..0000000 --- a/code/app/admin/model/VideoPlayurlModel.php +++ /dev/null @@ -1,96 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/VideoYearsModel.php b/code/app/admin/model/VideoYearsModel.php deleted file mode 100644 index f5895fc..0000000 --- a/code/app/admin/model/VideoYearsModel.php +++ /dev/null @@ -1,90 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/VideoYuyanModel.php b/code/app/admin/model/VideoYuyanModel.php deleted file mode 100644 index 3ed2949..0000000 --- a/code/app/admin/model/VideoYuyanModel.php +++ /dev/null @@ -1,90 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/VisitLogsModel.php b/code/app/admin/model/VisitLogsModel.php deleted file mode 100644 index 42771b8..0000000 --- a/code/app/admin/model/VisitLogsModel.php +++ /dev/null @@ -1,63 +0,0 @@ - $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; // 继续抛出异常 - } - } -} diff --git a/code/app/admin/model/XiaoShuoFenLeiModel.php b/code/app/admin/model/XiaoShuoFenLeiModel.php deleted file mode 100644 index 6d14688..0000000 --- a/code/app/admin/model/XiaoShuoFenLeiModel.php +++ /dev/null @@ -1,92 +0,0 @@ -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); - } -} diff --git a/code/app/admin/model/XiaoShuoXiangQingModel.php b/code/app/admin/model/XiaoShuoXiangQingModel.php deleted file mode 100644 index c57259c..0000000 --- a/code/app/admin/model/XiaoShuoXiangQingModel.php +++ /dev/null @@ -1,86 +0,0 @@ -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; - } - } -} diff --git a/code/app/admin/model/XiaoShuoZhangJieModel.php b/code/app/admin/model/XiaoShuoZhangJieModel.php deleted file mode 100644 index 01728cb..0000000 --- a/code/app/admin/model/XiaoShuoZhangJieModel.php +++ /dev/null @@ -1,49 +0,0 @@ -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); - } -} diff --git a/code/app/home/BaseController.php b/code/app/home/BaseController.php new file mode 100644 index 0000000..0966054 --- /dev/null +++ b/code/app/home/BaseController.php @@ -0,0 +1,97 @@ +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); + } + +} diff --git a/code/app/home/config/view.php b/code/app/home/config/view.php new file mode 100644 index 0000000..cd776ee --- /dev/null +++ b/code/app/home/config/view.php @@ -0,0 +1,5 @@ +'; - print_r($arrConfig); - echo ''; - // 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; } } diff --git a/code/app/home/controller/Novel.php b/code/app/home/controller/Novel.php new file mode 100644 index 0000000..0576f5d --- /dev/null +++ b/code/app/home/controller/Novel.php @@ -0,0 +1,17 @@ +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), + ]; + } +} diff --git a/code/app/admin/model/BaseModel.php b/code/app/model/BaseModel.php similarity index 91% rename from code/app/admin/model/BaseModel.php rename to code/app/model/BaseModel.php index 714d7d4..a4073ef 100644 --- a/code/app/admin/model/BaseModel.php +++ b/code/app/model/BaseModel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace app\admin\model; +namespace app\model; use think\facade\Cache; use think\Model; diff --git a/code/app/admin/model/CaiJiPeiZhiModel.php b/code/app/model/CaiJiPeiZhiModel.php similarity index 96% rename from code/app/admin/model/CaiJiPeiZhiModel.php rename to code/app/model/CaiJiPeiZhiModel.php index 94c570b..4d56c22 100644 --- a/code/app/admin/model/CaiJiPeiZhiModel.php +++ b/code/app/model/CaiJiPeiZhiModel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace app\admin\model; +namespace app\model; use think\facade\Cache; use think\Model; diff --git a/code/app/model/DomainModel.php b/code/app/model/DomainModel.php new file mode 100644 index 0000000..0956abd --- /dev/null +++ b/code/app/model/DomainModel.php @@ -0,0 +1,30 @@ +cache($strKey, 24 * 3600)->find(); + } + + static public function flushDomainCache($strDomain) + { + $strKey = "D:" . $strDomain; + return Cache::delete($strKey); + } +} diff --git a/code/app/admin/model/FenLeiModel.php b/code/app/model/FenLeiModel.php similarity index 99% rename from code/app/admin/model/FenLeiModel.php rename to code/app/model/FenLeiModel.php index b1145b5..0805f57 100644 --- a/code/app/admin/model/FenLeiModel.php +++ b/code/app/model/FenLeiModel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace app\admin\model; +namespace app\model; use think\facade\Cache; use think\Model; diff --git a/code/app/admin/model/PlanTaskModel.php b/code/app/model/PlanTaskModel.php similarity index 88% rename from code/app/admin/model/PlanTaskModel.php rename to code/app/model/PlanTaskModel.php index 8ccf7da..61ff6e5 100644 --- a/code/app/admin/model/PlanTaskModel.php +++ b/code/app/model/PlanTaskModel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace app\admin\model; +namespace app\model; use think\facade\Cache; use think\Model; diff --git a/code/app/admin/model/SystemConfigModel.php b/code/app/model/SystemConfigModel.php similarity index 96% rename from code/app/admin/model/SystemConfigModel.php rename to code/app/model/SystemConfigModel.php index 8c0eac6..92819bb 100644 --- a/code/app/admin/model/SystemConfigModel.php +++ b/code/app/model/SystemConfigModel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace app\admin\model; +namespace app\model; use think\facade\Cache; use think\Model; diff --git a/code/app/model/TemplatesModel.php b/code/app/model/TemplatesModel.php new file mode 100644 index 0000000..76fd069 --- /dev/null +++ b/code/app/model/TemplatesModel.php @@ -0,0 +1,42 @@ +column(null, 't_id'); + + Cache::tag('Templates')->set('Templates', $TemplatesCol); + } +} diff --git a/code/app/admin/model/ZiYuanDuanDianModel.php b/code/app/model/ZiYuanDuanDianModel.php similarity index 96% rename from code/app/admin/model/ZiYuanDuanDianModel.php rename to code/app/model/ZiYuanDuanDianModel.php index 025737a..e07890d 100644 --- a/code/app/admin/model/ZiYuanDuanDianModel.php +++ b/code/app/model/ZiYuanDuanDianModel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace app\admin\model; +namespace app\model; use think\facade\Cache; use think\Model; diff --git a/code/app/task/collection/PullDataColBase.php b/code/app/task/collection/PullDataColBase.php index 86a7700..fe9254a 100644 --- a/code/app/task/collection/PullDataColBase.php +++ b/code/app/task/collection/PullDataColBase.php @@ -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; diff --git a/code/app/task/collection/biquxs/BiquxsXiaoShuoCol.php b/code/app/task/collection/biquxs/BiquxsXiaoShuoCol.php index 8bbf374..e2887ff 100644 --- a/code/app/task/collection/biquxs/BiquxsXiaoShuoCol.php +++ b/code/app/task/collection/biquxs/BiquxsXiaoShuoCol.php @@ -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; diff --git a/code/app/task/collection/ccc5/XiaoShuo5cccCol.php b/code/app/task/collection/ccc5/XiaoShuo5cccCol.php index b65b96d..34d7e1a 100644 --- a/code/app/task/collection/ccc5/XiaoShuo5cccCol.php +++ b/code/app/task/collection/ccc5/XiaoShuo5cccCol.php @@ -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; diff --git a/code/app/task/collection/dadi/DaDiDianyingCol.php b/code/app/task/collection/dadi/DaDiDianyingCol.php index de2131f..521a264 100644 --- a/code/app/task/collection/dadi/DaDiDianyingCol.php +++ b/code/app/task/collection/dadi/DaDiDianyingCol.php @@ -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; diff --git a/code/app/task/collection/heimuer/HeiMuErYingShiCol.php b/code/app/task/collection/heimuer/HeiMuErYingShiCol.php index a555ef5..6b4be66 100644 --- a/code/app/task/collection/heimuer/HeiMuErYingShiCol.php +++ b/code/app/task/collection/heimuer/HeiMuErYingShiCol.php @@ -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; diff --git a/code/app/task/collection/novel/Zw630XiaoShuoCol.php b/code/app/task/collection/novel/Zw630XiaoShuoCol.php index 5982079..b55d430 100644 --- a/code/app/task/collection/novel/Zw630XiaoShuoCol.php +++ b/code/app/task/collection/novel/Zw630XiaoShuoCol.php @@ -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; diff --git a/code/app/task/collection/novelone/NovelJiuYuFanXianCol.php b/code/app/task/collection/novelone/NovelJiuYuFanXianCol.php index c0db786..65e501a 100644 --- a/code/app/task/collection/novelone/NovelJiuYuFanXianCol.php +++ b/code/app/task/collection/novelone/NovelJiuYuFanXianCol.php @@ -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; diff --git a/code/app/task/collection/novelone/NovelWenXueGuanCol.php b/code/app/task/collection/novelone/NovelWenXueGuanCol.php index e230888..a1f6d04 100644 --- a/code/app/task/collection/novelone/NovelWenXueGuanCol.php +++ b/code/app/task/collection/novelone/NovelWenXueGuanCol.php @@ -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; diff --git a/code/app/task/collection/seo/GenerateSiteMapCol.php b/code/app/task/collection/seo/GenerateSiteMapCol.php index 1f9cb21..4c3dfd6 100644 --- a/code/app/task/collection/seo/GenerateSiteMapCol.php +++ b/code/app/task/collection/seo/GenerateSiteMapCol.php @@ -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 { diff --git a/code/app/task/collection/seo/GenerateSiteMapNovel.php b/code/app/task/collection/seo/GenerateSiteMapNovel.php index 8538841..73a524c 100644 --- a/code/app/task/collection/seo/GenerateSiteMapNovel.php +++ b/code/app/task/collection/seo/GenerateSiteMapNovel.php @@ -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 { diff --git a/code/app/task/collection/seo/GenerateSiteMapNovelSk.php b/code/app/task/collection/seo/GenerateSiteMapNovelSk.php index f9da8b4..1d1cbc0 100644 --- a/code/app/task/collection/seo/GenerateSiteMapNovelSk.php +++ b/code/app/task/collection/seo/GenerateSiteMapNovelSk.php @@ -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 { diff --git a/code/app/task/collection/seo/GenerateSiteMapNovelZw.php b/code/app/task/collection/seo/GenerateSiteMapNovelZw.php index 4cf72b8..dc28062 100644 --- a/code/app/task/collection/seo/GenerateSiteMapNovelZw.php +++ b/code/app/task/collection/seo/GenerateSiteMapNovelZw.php @@ -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 { diff --git a/code/app/task/collection/tianlai/TianLaiXiaoShuoCol.php b/code/app/task/collection/tianlai/TianLaiXiaoShuoCol.php index 293552f..d49c299 100644 --- a/code/app/task/collection/tianlai/TianLaiXiaoShuoCol.php +++ b/code/app/task/collection/tianlai/TianLaiXiaoShuoCol.php @@ -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; diff --git a/code/app/task/collection/visitlogs/ContentStatsCol.php b/code/app/task/collection/visitlogs/ContentStatsCol.php index c44db75..25eb8d9 100644 --- a/code/app/task/collection/visitlogs/ContentStatsCol.php +++ b/code/app/task/collection/visitlogs/ContentStatsCol.php @@ -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 diff --git a/code/app/task/collection/visitlogs/VisitLogsCol.php b/code/app/task/collection/visitlogs/VisitLogsCol.php index 3b6b64d..e7e89f7 100644 --- a/code/app/task/collection/visitlogs/VisitLogsCol.php +++ b/code/app/task/collection/visitlogs/VisitLogsCol.php @@ -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 diff --git a/code/app/task/collection/yzzy/YouZhiYingShiCol.php b/code/app/task/collection/yzzy/YouZhiYingShiCol.php index 86a6aee..24013c8 100644 --- a/code/app/task/collection/yzzy/YouZhiYingShiCol.php +++ b/code/app/task/collection/yzzy/YouZhiYingShiCol.php @@ -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; diff --git a/code/app/task/logic/AdTask.php b/code/app/task/logic/AdTask.php index 3c192f4..e9ccb3c 100644 --- a/code/app/task/logic/AdTask.php +++ b/code/app/task/logic/AdTask.php @@ -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; /** diff --git a/code/app/task/module/PlanTask.php b/code/app/task/module/PlanTask.php index 20b9600..625e85a 100644 --- a/code/app/task/module/PlanTask.php +++ b/code/app/task/module/PlanTask.php @@ -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; diff --git a/code/composer.json b/code/composer.json index 84634b7..53dd320 100644 --- a/code/composer.json +++ b/code/composer.json @@ -25,12 +25,15 @@ "topthink/think-orm": "^3.0|^4.0", "topthink/think-filesystem": "^2.0", "topthink/think-multi-app": "^1.1", - "topthink/think-view": "^1.0", + "topthink/think-view": "^2.0", "guzzlehttp/guzzle": "^7.8", "jaeger/querylist": "^4.2", "topthink/think-migration": "^3.1", "topthink/think-helper": "^3.1", - "fakerphp/faker": "^1.23" + "fakerphp/faker": "^1.23", + "aws/aws-sdk-php": "^3.337", + "league/flysystem": "^1.1", + "league/flysystem-aws-s3-v3": "^1.0" }, "require-dev": { "topthink/think-dumper": "^1.0", @@ -54,4 +57,4 @@ "@php think vendor:publish" ] } -} \ No newline at end of file +} diff --git a/code/config/app.php b/code/config/app.php index 1c01474..41ce8eb 100644 --- a/code/config/app.php +++ b/code/config/app.php @@ -6,19 +6,32 @@ return [ // 应用的命名空间 'app_namespace' => '', + // 是否启用路由 'with_route' => true, + // 默认应用 'default_app' => 'home', + // 默认时区 'default_timezone' => 'Asia/Shanghai', // 应用映射(自动多应用模式有效) - 'app_map' => [], + 'app_map' => [ + 'admin' => 'admin' + ], + // 域名绑定(自动多应用模式有效) - 'domain_bind' => [], + 'domain_bind' => [ + '*' => 'home', + 'adapi' => 'admin', + ], + // 禁止URL访问的应用列表(自动多应用模式有效) - 'deny_app_list' => [], + 'deny_app_list' => [ + 'task', + 'model', + ], // 异常页面的模板文件 'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl', diff --git a/code/config/storage.php b/code/config/storage.php new file mode 100644 index 0000000..2b2973c --- /dev/null +++ b/code/config/storage.php @@ -0,0 +1,24 @@ + [ + // 端点 + 'endpoint' => env('MINIO_END_POINT', '127.0.0.1:9000'), + // KEY + 'key' => env('MINIO_KEY', ''), + // 密钥 + 'secret' => env('MINIO_SECRET', ''), + // 区域 + 'region' => env('MINIO_REGION', 'us-east-1'), + // 桶 + 'bucket' => env('MINIO_BUCKET', 'my-bucket'), + + ], + 'local' => [ + 'dir' => env('STORAGE_LOCAL_DIR', ''), + ] + +]; diff --git a/code/database/migrations/20240717191901_add_gg_pai_xu_colum_on_guang_gao_table.php b/code/database/migrations/20240717191901_add_gg_pai_xu_colum_on_guang_gao_table.php index eb97147..08988b7 100644 --- a/code/database/migrations/20240717191901_add_gg_pai_xu_colum_on_guang_gao_table.php +++ b/code/database/migrations/20240717191901_add_gg_pai_xu_colum_on_guang_gao_table.php @@ -5,16 +5,16 @@ use think\migration\db\Column; class AddGgPaiXuColumOnGuangGaoTable extends Migrator { - public function up() - { - $Table = $this->table('guang_gao'); + // public function up() + // { + // $Table = $this->table('guang_gao'); - $Table->addColumn('gg_sort', 'integer', ['after' => 'gg_tiao_zhuan_di_zhi'])->setComment("排序")->save(); - } + // $Table->addColumn('gg_sort', 'integer', ['after' => 'gg_tiao_zhuan_di_zhi'])->setComment("排序")->save(); + // } - public function down() - { - $Table = $this->table('guang_gao'); - $Table->removeColumn('gg_sort')->save(); - } + // public function down() + // { + // $Table = $this->table('guang_gao'); + // $Table->removeColumn('gg_sort')->save(); + // } } diff --git a/code/database/migrations/20240809204922_seo_keywords_table.php b/code/database/migrations/20240809204922_seo_keywords_table.php deleted file mode 100644 index 97f4780..0000000 --- a/code/database/migrations/20240809204922_seo_keywords_table.php +++ /dev/null @@ -1,46 +0,0 @@ -table('seo_keywords', [ - 'id' => 'sw_id' // 这里指定 sw_id 作为自增主键 - ]); - - // 添加 sw_title 字段,类型为字符串 - $table->addColumn('sw_title', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '关键词标题' - ]); - - // 添加 sw_status 字段,类型为布尔值或整数 - $table->addColumn('sw_status', 'boolean', [ - 'default' => 0, - 'null' => false, - 'comment' => '关键词状态,1表示启用,0表示禁用' - ]); - - // 添加 sw_html_path 字段,类型为字符串 - $table->addColumn('sw_html_path', 'string', [ - 'limit' => 255, - 'null' => true, - 'comment' => '关键词关联的HTML路径' - ]); - - // 为 sw_html_path 字段添加索引 - $table->addIndex(['sw_html_path'], [ - 'unique' => false, // 如果你希望索引是唯一的,设置为 true - 'name' => 'idx_sw_html_path' // 索引名称,可以省略,系统会自动生成 - ]); - - // 创建表 - $table->create(); -} - -} diff --git a/code/database/migrations/20240924114816_guanggao_add_status.php b/code/database/migrations/20240924114816_guanggao_add_status.php deleted file mode 100644 index a381186..0000000 --- a/code/database/migrations/20240924114816_guanggao_add_status.php +++ /dev/null @@ -1,20 +0,0 @@ -table('guang_gao'); - - $Table->addColumn('gg_status', 'integer', ['after' => 'gg_tiao_zhuan_di_zhi', 'default' => 0])->setComment("状态")->save(); - } - - public function down() - { - $Table = $this->table('guang_gao'); - $Table->removeColumn('gg_status')->save(); - } -} diff --git a/code/database/migrations/20250104155836_video_class.php b/code/database/migrations/20250104155836_video_class.php deleted file mode 100644 index 1fc84fd..0000000 --- a/code/database/migrations/20250104155836_video_class.php +++ /dev/null @@ -1,65 +0,0 @@ -table('video_class', [ - 'id' => 'vc_id' // 这里指定 sw_id 作为自增主键 - ]); - - // 添加 vc_name 字段,类型为字符串 - $table->addColumn('vc_name', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '分类名称' - ]); - // 添加 vc_name 字段,类型为字符串 - $table->addColumn('vc_nicheng', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '分类昵称' - ]); - - $table->addColumn('vc_sort', 'integer', [ - 'limit' => 255, - 'default'=>0, - 'comment' => '排序' - ]); - // 添加 vc_status 字段,类型为布尔值或整数 - $table->addColumn('vc_status', 'boolean', [ - 'default' => 1, - 'null' => false, - 'comment' => '关键词状态,1表示启用,0表示禁用' - ]); - - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250104160751_video_leixin.php b/code/database/migrations/20250104160751_video_leixin.php deleted file mode 100644 index 56818f2..0000000 --- a/code/database/migrations/20250104160751_video_leixin.php +++ /dev/null @@ -1,65 +0,0 @@ -table('video_leixin', [ - 'id' => 'vl_id' // 这里指定 sw_id 作为自增主键 - ]); - - // 添加 vc_id 字段, - $table->addColumn('vc_id', 'integer', [ - 'limit' => 11, - 'null' => false, - 'comment' => '分类id' - ]); - - // 添加 vl_name 字段,类型为字符串 - $table->addColumn('vl_name', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '类型名称' - ]); - // 添加 vp_sort 字段, - $table->addColumn('vl_sort', 'integer', [ - 'default'=>0, - 'comment' => '排序' - ]); - - // 添加 vc_status 字段,类型为布尔值或整数 - $table->addColumn('vl_status', 'boolean', [ - 'default' => 1, - 'null' => false, - 'comment' => '关键词状态,1表示启用,0表示禁用' - ]); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250104161057_video_juqing.php b/code/database/migrations/20250104161057_video_juqing.php deleted file mode 100644 index 86fce07..0000000 --- a/code/database/migrations/20250104161057_video_juqing.php +++ /dev/null @@ -1,58 +0,0 @@ -table('video_juqing', [ - 'id' => 'vj_id' // 这里指定 sw_id 作为自增主键 - ]); - - // 添加 vc_id 字段, - $table->addColumn('vc_id', 'integer', [ - 'limit' => 11, - 'null' => false, - 'comment' => '分类id' - ]); - - // 添加 vl_name 字段,类型为字符串 - $table->addColumn('vj_name', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '剧情名称' - ]); - // 添加 vp_sort 字段, - $table->addColumn('vj_sort', 'integer', [ - 'default'=>0, - 'comment' => '排序' - ]); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250104161633_video_diqu.php b/code/database/migrations/20250104161633_video_diqu.php deleted file mode 100644 index 2b2db29..0000000 --- a/code/database/migrations/20250104161633_video_diqu.php +++ /dev/null @@ -1,59 +0,0 @@ -table('video_diqu', [ - 'id' => 'vd_id' // 这里指定 sw_id 作为自增主键 - ]); - - // 添加 vc_id 字段, - $table->addColumn('vc_id', 'integer', [ - 'limit' => 11, - 'null' => false, - 'comment' => '分类id' - ]); - - // 添加 vl_name 字段,类型为字符串 - $table->addColumn('vd_name', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '地区名称' - ]); - // 添加 vp_sort 字段, - $table->addColumn('vd_sort', 'integer', [ - 'limit' => 255, - 'default'=>0, - 'comment' => '排序' - ]); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250104161642_video_years.php b/code/database/migrations/20250104161642_video_years.php deleted file mode 100644 index 8c93134..0000000 --- a/code/database/migrations/20250104161642_video_years.php +++ /dev/null @@ -1,58 +0,0 @@ -table('video_years', [ - 'id' => 'vy_id' // 这里指定 sw_id 作为自增主键 - ]); - - // 添加 vc_id 字段, - $table->addColumn('vc_id', 'integer', [ - 'limit' => 11, - 'null' => false, - 'comment' => '分类id' - ]); - - // 添加 vl_name 字段,类型为字符串 - $table->addColumn('vy_name', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '年份名称' - ]); - // 添加 vp_sort 字段, - $table->addColumn('vy_sort', 'integer', [ - 'limit' => 255, - 'default'=>0, - 'comment' => '排序' - ]); - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250104161650_video_language.php b/code/database/migrations/20250104161650_video_language.php deleted file mode 100644 index cc4afa4..0000000 --- a/code/database/migrations/20250104161650_video_language.php +++ /dev/null @@ -1,59 +0,0 @@ -table('video_language', [ - 'id' => 'vla_id' // 这里指定 sw_id 作为自增主键 - ]); - - // 添加 vc_id 字段, - $table->addColumn('vc_id', 'integer', [ - 'limit' => 11, - 'null' => false, - 'comment' => '分类id' - ]); - - // 添加 vl_name 字段,类型为字符串 - $table->addColumn('vla_name', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '语言名称' - ]); - // 添加 vp_sort 字段, - $table->addColumn('vla_sort', 'integer', [ - 'limit' => 255, - 'default'=>0, - 'comment' => '排序' - ]); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250104162037_video_info.php b/code/database/migrations/20250104162037_video_info.php deleted file mode 100644 index 8815930..0000000 --- a/code/database/migrations/20250104162037_video_info.php +++ /dev/null @@ -1,91 +0,0 @@ -table('video_info', [ - 'id' => 'v_id' // 这里指定 v_id 作为自增主键 - ]); - $table->addColumn('v_name', 'string', ['limit' => 255,'null' => false,'comment' => '名称']); - $table->addColumn('v_cover', 'json', ['default' => null, 'null' => true, 'comment' => '封面']); - - $table->addColumn('vc_id', 'integer', ['comment' => '视频分类id:1电影,2电视剧,3综艺,4动漫']); - - $table->addColumn('v_pinyin', 'string', ['limit' => 255,'comment' => '[拼音id]']); - $table->addColumn('v_leixin', 'string', ['limit' => 255,'null' => true,'comment' => '类型']); - $table->addColumn('v_juqing', 'string', ['limit' => 255,'null' => true,'comment' => '剧情']); - $table->addColumn('v_diqu', 'string', ['limit' => 255,'null' => true,'comment' => '地区']); - $table->addColumn('v_years', 'string', ['limit' => 255,'null' => true,'comment' => '年份']); - $table->addColumn('v_language', 'string', ['limit' => 255,'null' => true,'comment' => '语言']); - - $table->addColumn('v_daoyan', 'string', ['limit' => 255,'null' => true,'comment' => '导演']); - $table->addColumn('v_zhuyan', 'string', ['limit' => 255,'null' => true,'comment' => '主演']); - $table->addColumn('v_orurl', 'string', ['limit' => 255,'comment' => '来源url']); - $table->addColumn('v_md5', 'string', ['limit' => 255,'comment' => 'md5:vc_id+v_name+v_orurl']); - $table->addColumn('v_jiaobiao', 'string', ['limit' => 255,'null' => true,'comment' => '角标']); - - $table->addColumn('v_description', 'text', ['comment' => '简介']); - - $table->addColumn('v_pingfen', 'decimal', ['precision' => 10, 'scale' => 2, 'default' => 0, 'comment' => '评分']); - $table->addColumn('v_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常')); - - $table->addColumn('v_click', 'integer', ['default'=>0,'comment' => '点击数']); - $table->addColumn('v_recommend', 'integer', ['default'=>0,'comment' => '推荐等级']); - - - $table->addColumn('update_time', 'datetime', ['null' => true, 'comment' => '更新时间']); - $table->addColumn('create_time', 'datetime', ['null' => true, 'comment' => '创建时间']); - - $table->addIndex('vc_id'); - $table->addIndex('v_md5'); - $table->addIndex('v_pinyin'); - $table->addIndex('v_status'); - // 添加复合索引 idx_vc_id_pingfen - $table->addIndex(['vc_id', 'v_pingfen'], [ - 'name' => 'idx_vc_id_pingfen', - 'unique' => false - ]); - - // 添加复合索引 idx_vc_id_v_click - $table->addIndex(['vc_id', 'v_click'], [ - 'name' => 'idx_vc_id_v_click', - 'unique' => false - ]); - - // 创建表 - $table->create(); - - -// $table->string('head_title',100)->default('')->comment('seo-标题'); -// $table->string('head_keyword',200)->default('')->comment('seo-关键词'); -// $table->string('head_description',255)->default('')->comment('seo-描述'); - - - } -} diff --git a/code/database/migrations/20250104162430_video_playurl.php b/code/database/migrations/20250104162430_video_playurl.php deleted file mode 100644 index aad12e0..0000000 --- a/code/database/migrations/20250104162430_video_playurl.php +++ /dev/null @@ -1,68 +0,0 @@ -table('video_playurl', [ - 'id' => 'vp_id' // 这里指定 vp_id 作为自增主键 - ]); - - // 添加 v_id 字段, - $table->addColumn('v_id', 'integer', [ - 'comment' => '视频id' - ]); - - // 添加 vp_sort 字段, - $table->addColumn('vp_sort', 'integer', [ - 'default'=>0, - 'comment' => '线路排序' - ]); - - // 添加 vp_md5 字段, - $table->addColumn('vp_md5', 'string', [ - 'limit' => 255, - 'comment' => 'md5:v_id+vp_url' - ]); - - - // 添加 vp_name 字段,类型为字符串 - $table->addColumn('vp_name', 'string', [ - 'limit' => 255, - 'null' => false, - 'comment' => '线路名称' - ]); - - $table->addColumn('vp_url', 'json', [ 'null' => false, 'comment' => '播放地址']); - $table->addIndex('v_id'); - $table->addIndex('vp_md5'); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250105042300_gan_rao_ma.php b/code/database/migrations/20250105042300_gan_rao_ma.php deleted file mode 100644 index 23ab996..0000000 --- a/code/database/migrations/20250105042300_gan_rao_ma.php +++ /dev/null @@ -1,62 +0,0 @@ -table('gan_rao_ma', [ - 'id' => 'grm_id' // 这里指定 grm_id 作为自增主键 - ]); - - // 添加 grm_neirong 字段,类型为字符串 - $table->addColumn('grm_neirong', 'text', [ - 'null' => false, - 'comment' => '干扰码内容' - ]); - - // 添加 grm_status 字段,类型为布尔值或整数 - $table->addColumn('grm_status', 'boolean', [ - 'default' => 0, - 'null' => false, - 'comment' => '干扰码状态,1表示启用,0表示禁用' - ]); - - // 添加 grm_html_path 字段,类型为字符串 - $table->addColumn('grm_html_path', 'string', [ - 'limit' => 255, - 'null' => true, - 'comment' => '干扰码关联的HTML路径' - ]); - - // 为 grm_html_path 字段添加索引 - $table->addIndex('grm_html_path'); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250108092206_seo_tdk_config.php b/code/database/migrations/20250108092206_seo_tdk_config.php deleted file mode 100644 index df260be..0000000 --- a/code/database/migrations/20250108092206_seo_tdk_config.php +++ /dev/null @@ -1,48 +0,0 @@ -table('seo_tdk_config', [ - 'id' => 'stc_id' // 这里指定 stc_id 作为自增主键 - ]); - $table->addColumn('stc_code', 'string', ['limit' => 255,'null' => false,'comment' => '编码标识']); - $table->addColumn('stc_name', 'string', ['limit' => 255,'null' => true,'comment' => '页面名称']); - $table->addColumn('stc_title', 'string', ['limit' => 255,'null' => true,'comment' => '页面标题']); - $table->addColumn('stc_keywords', 'string', ['limit' => 255,'null' => true,'comment' => '页面关键词']); - $table->addColumn('stc_description', 'string', ['limit' => 255,'null' => true,'comment' => '页面描述']); - $table->addColumn('stc_other_conf', 'string', ['limit' => 255,'null' => true,'comment' => '其它配置']); - $table->addColumn('stc_tongji_daima', 'string', ['limit' => 255,'null' => true,'comment' => '页面统计代码']); - $table->addColumn('stc_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常')); - $table->addIndex('stc_code'); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250110025821_create_visit_logs.php b/code/database/migrations/20250110025821_create_visit_logs.php deleted file mode 100644 index a4020ab..0000000 --- a/code/database/migrations/20250110025821_create_visit_logs.php +++ /dev/null @@ -1,56 +0,0 @@ -table('visit_logs', [ - 'id' => 'vil_id' // 这里指定 stc_id 作为自增主键 - ]); - - $visitLogsTable->addColumn('vil_ip', 'string', ['limit' => 45, 'null' => false, 'comment' => '访问者 IP 地址']) - ->addColumn('vil_url', 'text', ['null' => false, 'comment' => '访问的 URL']) - ->addColumn('vil_method', 'string', ['limit' => 10, 'null' => false, 'comment' => 'HTTP 方法']) - ->addColumn('vil_content_type', 'enum', ['values' => ['video', 'novel', 'page'], 'null' => false, 'comment' => '内容类型(视频、小说、页面)']) - ->addColumn('vil_content_id', 'string', ['default' => '','null' => false, 'comment' => '内容 ID(视频、小说或页面的唯一标识)']) - - ->addColumn('vil_user_agent', 'text', ['null' => true, 'comment' => 'User-Agent 信息']) - ->addColumn('vil_headers', 'text', ['null' => true, 'comment' => '请求头信息']) - ->addColumn('vil_is_spider', 'boolean', ['default' => 0, 'comment' => '是否为爬虫:0-否,1-是']) - ->addColumn('vil_location', 'text', ['null' => true, 'comment' => '地理位置']) - ->addColumn('vil_user_id', 'biginteger', ['null' => true, 'comment' => '用户 ID(可选)']) - ->addColumn('vil_timestamp', 'datetime', ['null' => true,'default' => 'CURRENT_TIMESTAMP', 'comment' => '访问时间']) - // 添加索引 - ->addIndex(['vil_content_type', 'vil_content_id'], ['name' => 'idx_content_type_id']) - ->addIndex('vil_timestamp', ['name' => 'idx_timestamp']) - ->addIndex('vil_is_spider', ['name' => 'idx_is_spider']) - ->addIndex('vil_user_id', ['name' => 'idx_user_id']) - ->addIndex('vil_ip', ['name' => 'idx_ip']) - ->create(); - } -} diff --git a/code/database/migrations/20250110065748_create_content_stats.php b/code/database/migrations/20250110065748_create_content_stats.php deleted file mode 100644 index fc44bee..0000000 --- a/code/database/migrations/20250110065748_create_content_stats.php +++ /dev/null @@ -1,87 +0,0 @@ -table('content_stats', [ - 'id' => 'cs_id' // 这里指定 stc_id 作为自增主键 - ]); - - - $table->addColumn('cs_content_type', 'enum', [ - 'values' => ['video', 'novel', 'page'], // 扩展支持页面 - 'null' => false, - 'comment' => '内容类型(视频、小说、页面)' - ]) - ->addColumn('cs_content_id', 'string', [ - 'null' => false, - 'comment' => '内容 ID(视频、小说或页面 ID)' - ]) - ->addColumn('cs_stat_date', 'string', [ - 'null' => false, - 'comment' => '统计日期' - ]) - ->addColumn('cs_stat_period', 'enum', [ - 'values' => ['day', 'week', 'month', 'quarter', 'year'], - 'null' => false, - 'comment' => '统计周期' - ]) - ->addColumn('cs_pv', 'integer', [ - 'null' => false, - 'default' => 0, - 'comment' => '页面浏览量(PV)' - ]) - ->addColumn('cs_uv', 'integer', [ - 'null' => false, - 'default' => 0, - 'comment' => '独立访客量(UV)' - ]) - ->addColumn('updated_at', 'timestamp', [ - 'default' => 'CURRENT_TIMESTAMP', - 'update' => 'CURRENT_TIMESTAMP', - 'comment' => '更新时间' - ]) - ->addColumn('cs_md5', 'string', [ - 'default' => '', - 'null' => false, - 'comment' => 'md5(cs_content_type+cs_content_id+cs_stat_date+cs_stat_period' - ]) - // 添加索引 - ->addIndex('cs_content_type', ['name' => 'cs_content_type']) - ->addIndex('cs_content_id', ['name' => 'cs_content_id']) - ->addIndex('cs_stat_date', ['name' => 'cs_stat_date']) - ->addIndex('cs_stat_period', ['name' => 'cs_stat_period']) - ->addIndex(['cs_md5'], [ - 'unique' => true, - 'name' => 'unique_cs_md5' - ]) - ->create(); - } -} diff --git a/code/database/migrations/20250212095020_add_new_column_to_video_info.php b/code/database/migrations/20250212095020_add_new_column_to_video_info.php deleted file mode 100644 index 931f471..0000000 --- a/code/database/migrations/20250212095020_add_new_column_to_video_info.php +++ /dev/null @@ -1,41 +0,0 @@ -table('video_info'); - - // 添加 "影院售票总额" 字段 - $table->addColumn('v_ticket_sales', 'decimal', [ - 'precision' => 12, // 最大 9999999999.99 - 'scale' => 2, // 保留两位小数 - 'default' => 0.00, // 默认值 0.00 - 'comment' => '影院售票总额(单位:亿元)' - ])->update(); - } -} diff --git a/code/database/migrations/20250215153113_seo_html.php b/code/database/migrations/20250215153113_seo_html.php deleted file mode 100644 index 877993e..0000000 --- a/code/database/migrations/20250215153113_seo_html.php +++ /dev/null @@ -1,48 +0,0 @@ -table('seo_html', [ - 'id' => 'sh_id' // 这里指定 v_id 作为自增主键 - ]); - $table->addColumn('sh_title', 'string', ['limit' => 255,'null' => false,'comment' => 'title']); - $table->addColumn('sh_keywords', 'string', ['limit' => 255,'null' => false,'comment' => 'keywords']); - $table->addColumn('sh_description', 'text', ['comment' => '简介']); - $table->addColumn('sh_body', 'text', ['comment' => '内容']); - $table->addColumn('sh_click', 'integer', ['default'=>0,'comment' => '点击数']); - $table->addColumn('sh_html_path', 'string', ['limit' => 255, 'null' => true,'comment' => 'HTML源文件路径']); - $table->addColumn('update_time', 'datetime', ['null' => true, 'comment' => '更新时间']); - $table->addColumn('create_time', 'datetime', ['null' => true, 'comment' => '创建时间']); - $table->addIndex('sh_html_path'); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250219155929_create_xiao_shuo_xiang_qing_seo.php b/code/database/migrations/20250219155929_create_xiao_shuo_xiang_qing_seo.php deleted file mode 100644 index 4bba43b..0000000 --- a/code/database/migrations/20250219155929_create_xiao_shuo_xiang_qing_seo.php +++ /dev/null @@ -1,54 +0,0 @@ -table('novel_info_seo', [ - 'id' => 'nis_id' // 这里指定 v_id 作为自增主键 - ]); - $table->addColumn('nis_name', 'string', ['limit' => 255,'null' => false,'comment' => '名称']); - - $table->addColumn('nis_jie_shao', 'text', ['comment' => '介绍']); - - $table->addColumn('xsxq_id', 'integer', ['comment' => '小说详情id']); - - $table->addColumn('nis_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常')); - - $table->addColumn('nis_click', 'integer', ['default'=>0,'comment' => '点击数']); - - $table->addColumn('nis_md5', 'string', ['limit' => 255,'comment' => 'md5:xsxq_id+nis_name']); - - $table->addIndex('xsxq_id'); - $table->addIndex('nis_md5'); - - // 创建表 - $table->create(); - - } -} diff --git a/code/database/migrations/20250221094510_add_new_column_to_xiao_shuo_zhang_jie.php b/code/database/migrations/20250221094510_add_new_column_to_xiao_shuo_zhang_jie.php deleted file mode 100644 index fd7a4d3..0000000 --- a/code/database/migrations/20250221094510_add_new_column_to_xiao_shuo_zhang_jie.php +++ /dev/null @@ -1,56 +0,0 @@ -table('xiao_shuo_zhang_jie'); - - // 添加 "章节索引" 字段 - $table->addColumn('xszj_sort', 'integer', [ - 'default' => 1, - 'comment' => '章节索引' - ]); - - // 修改字段 "xszj_ming_zi",使其不能为空 - $table->changeColumn('xszj_ming_zi', 'string', [ - 'null' => false, // 设置字段为 NOT NULL - 'comment' => '章节名称' - ]); - - // 添加 "xszj_source_code" 字段并设置为唯一 - // $table->addColumn('xszj_source_code', 'string', [ - // 'null' => false, - // 'comment' => '来源代码' - // ]); - - // 为 "xszj_source_code" 添加唯一索引,确保其值唯一 - //$table->addIndex(['xszj_source_code'], ['unique' => true]); - - $table->update(); - } -} diff --git a/code/database/migrations/20250223165039_create_video_info_seo.php b/code/database/migrations/20250223165039_create_video_info_seo.php deleted file mode 100644 index f28b76a..0000000 --- a/code/database/migrations/20250223165039_create_video_info_seo.php +++ /dev/null @@ -1,54 +0,0 @@ -table('video_info_seo', [ - 'id' => 'vis_id' // 这里指定 v_id 作为自增主键 - ]); - $table->addColumn('vis_name', 'string', ['limit' => 255,'null' => false,'comment' => '名称']); - - $table->addColumn('vis_jie_shao', 'text', ['comment' => '介绍']); - - $table->addColumn('v_id', 'integer', ['comment' => '详情id']); - - $table->addColumn('vis_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常')); - - $table->addColumn('vis_click', 'integer', ['default'=>0,'comment' => '点击数']); - - $table->addColumn('vis_md5', 'string', ['limit' => 255,'comment' => 'md5:v_id+vis_name']); - - $table->addIndex('v_id'); - $table->addIndex('vis_md5'); - - // 创建表 - $table->create(); - - } -} diff --git a/code/database/migrations/20250223165052_create_site.php b/code/database/migrations/20250223165052_create_site.php deleted file mode 100644 index fe5d281..0000000 --- a/code/database/migrations/20250223165052_create_site.php +++ /dev/null @@ -1,56 +0,0 @@ -table('site', [ - 'id' => 'site_id' // 这里指定 v_id 作为自增主键 - ]); - $table->addColumn('site_name', 'string', ['limit' => 255,'null' => false,'comment' => '名称']); - $table->addColumn('site_type', 'string', ['limit' => 255,'null' => false,'comment' => '站点类型:novel.video']); - $table->addColumn('site_log_type', 'string', ['limit' => 255,'null' => false,'comment' => 'logo类型 1:图片,2:文字']); - $table->addColumn('site_email', 'string', ['limit' => 255,'null' => false,'comment' => '邮箱']); - $table->addColumn('site_telegram', 'string', ['limit' => 255,'null' => false,'comment' => 'Telegram']); - $table->addColumn('site_domain', 'string', ['limit' => 255,'null' => false,'comment' => '域名']); - $table->addColumn('site_share_domain', 'string', ['limit' => 255,'null' => false,'comment' => '分享域名']); - $table->addColumn('site_version', 'string', ['limit' => 255,'null' => false,'comment' => '版本号']); - $table->addColumn('site_fenlei_path', 'string', ['limit' => 255,'null' => true,'comment' => '分类路由目录']); - $table->addColumn('site_xiangqing_path', 'string', ['limit' => 255,'null' => true,'comment' => '详情路由目录']); - $table->addColumn('site_zhangjie_path', 'string', ['limit' => 255,'null' => true,'comment' => '章节路由目录']); - $table->addColumn('site_rank_path', 'string', ['limit' => 255,'null' => true,'comment' => '排行榜路由目录']); - $table->addColumn('site_tui_jian_path', 'string', ['limit' => 255,'null' => true,'comment' => '推荐路由目录']); - $table->addColumn('site_seo_path', 'string', ['limit' => 255,'null' => true,'comment' => '详情seo词路由目录']); - $table->addColumn('site_zdy_path', 'string', ['limit' => 255,'null' => true,'comment' => '自定义seo页面路由目录']); - $table->addColumn('site_tongji', 'text', ['comment' => '统计']); - $table->addColumn('site_status', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'状态:0:正常,1:异常')); - - // 创建表 - $table->create(); - } -} diff --git a/code/database/migrations/20250223165158_add_clouma_to_all_table_add_site.php b/code/database/migrations/20250223165158_add_clouma_to_all_table_add_site.php deleted file mode 100644 index e0dd402..0000000 --- a/code/database/migrations/20250223165158_add_clouma_to_all_table_add_site.php +++ /dev/null @@ -1,57 +0,0 @@ -hasTable($table)) { - $tableObject = $this->table($table); - - // 检查是否已经有 site_id 字段 - if (!$tableObject->hasColumn('site_id')) { - $tableObject->addColumn('site_id', 'integer', [ - 'default' => 1, - 'comment' => '站点ID' - ]); - } - - // 添加索引(避免重复添加索引) - if (!$tableObject->hasIndex(['site_id'])) { - $tableObject->addIndex(['site_id']); - } - - $tableObject->update(); - } - } - } - - -} diff --git a/code/database/migrations/20250224031014_add_cloumn_to_xiao_shuo_fen_lei.php b/code/database/migrations/20250224031014_add_cloumn_to_xiao_shuo_fen_lei.php deleted file mode 100644 index 90e0fdb..0000000 --- a/code/database/migrations/20250224031014_add_cloumn_to_xiao_shuo_fen_lei.php +++ /dev/null @@ -1,34 +0,0 @@ -table('xiao_shuo_fen_lei'); - if (!$Table->hasColumn('xsfl_sort')) { - $Table->addColumn('xsfl_sort', 'integer', ['after' => 'site_id'])->setComment("排序")->save(); - } - - $Table = $this->table('video_class'); - if (!$Table->hasColumn('vc_source_id')) { - $Table->addColumn('vc_source_id', 'integer', ['after' => 'site_id'])->setComment("资源绑定真实id")->save(); - } - } - - public function down() - { - $Table = $this->table('xiao_shuo_fen_lei'); - if ($Table->hasColumn('xsfl_sort')) { - $Table->removeColumn('xsfl_sort')->save(); - } - - $Table = $this->table('video_class'); - if ($Table->hasColumn('vc_source_id')) { - $Table->removeColumn('vc_source_id')->save(); - } - - } -} diff --git a/code/database/seeders/PlanTaskSeeder.php b/code/database/seeders/PlanTaskSeeder.php index f64ee9b..eb00f0b 100644 --- a/code/database/seeders/PlanTaskSeeder.php +++ b/code/database/seeders/PlanTaskSeeder.php @@ -9,112 +9,23 @@ class PlanTaskSeeder { static public function handle() { - // 公共任务 - $arrData = [ - [ - 'pt_name' => '统计汇总', - 'pt_code' => 'PULL_TONJI_HUIZON', - 'pt_enable' => 0, - 'pt_limit' => 24 * 3600, - ], - ]; - - foreach ($arrData as $arrPlanTask) { - $PlanTaskModel = PlanTaskModel::where('pt_code', $arrPlanTask['pt_code'])->find(); - - if (empty($PlanTaskModel)) { - PlanTaskModel::insert($arrPlanTask); - } - } - - if (config('app.default_app_type') == 'video') { - self::addVideoTypePlanTask(); - } - if (config('app.default_app_type') == 'novel') { - self::addNovelTypePlanTask(); - } + self::addNovelTypePlanTask(); } - // 添加视频类型站点 爬虫任务 - static public function addVideoTypePlanTask() - { - $arrData = [ - [ - 'pt_name' => '采集大地电影', - 'pt_code' => 'PULL_DADI_DIANYHHING', - 'pt_enable' => 0, - 'pt_limit' => 24 * 3600, - ], - [ - 'pt_name' => '采集黑木耳资源', - 'pt_code' => 'PULL_HEI_MUER', - 'pt_enable' => 0, - 'pt_limit' => 12 * 3600, - ], - [ - 'pt_name' => '采集优质资源', - 'pt_code' => 'PULL_YOUZHI', - 'pt_enable' => 0, - 'pt_limit' => 12 * 3600, - ] - ]; - foreach ($arrData as $arrPlanTask) { - $NovelOnePlanTaskModel = PlanTaskModel::where('pt_code', $arrPlanTask['pt_code'])->find(); - - if (empty($NovelOnePlanTaskModel)) { - PlanTaskModel::insert($arrPlanTask); - } - } - } // 添加小说类型站点 爬虫任务 static public function addNovelTypePlanTask() { $arrDataNovel = [ - [ - 'pt_name' => '123采集小说', - 'pt_code' => 'PULL_XIAOSHUO', - 'pt_enable' => 0, - 'pt_limit' => 24 * 3600, - ], - [ - 'pt_name' => '采集天籁小说', - 'pt_code' => 'PULL_TIANLAIXIAOSHUO', - 'pt_enable' => 0, - 'pt_limit' => 24 * 3600, - ], - [ - 'pt_name' => '采集biquxs小说', - 'pt_code' => 'PULL_BIQUXSXIAOSHUO', - 'pt_enable' => 0, - 'pt_limit' => 24 * 3600, - ], - [ - 'pt_name' => '采集5ccc小说', - 'pt_code' => 'PULL_5CCCXIAOSHUO', - 'pt_enable' => 0, - 'pt_limit' => 24 * 3600, - ], - [ - 'pt_name' => '采集630zw.org小说', - 'pt_code' => 'PULL_630ZWXIAOSHUO', - 'pt_enable' => 0, - 'pt_limit' => 24 * 3600, - ], - [ - 'pt_name' => '采集鬼吹灯小说', // 采集鬼吹灯-九域凡仙小说 - 'pt_code' => 'PULL_GUICHUIDENG_XIAOSHUO', - 'pt_enable' => 0, - 'pt_limit' => 24 * 3600 * 3, - ], + [ 'pt_name' => '采集文学馆小说', // 采集文学馆-都市极品医神 'pt_code' => 'PULL_WENXUEGUAN_XIAOSHUO', 'pt_enable' => 0, 'pt_limit' => 24 * 3600 * 3, ], - + ]; foreach ($arrDataNovel as $arrPlanTask) { $NovelOnePlanTaskModel = PlanTaskModel::where('pt_code', $arrPlanTask['pt_code'])->find(); diff --git a/code/database/seeders/VideoInfoSeeder.php b/code/database/seeders/VideoInfoSeeder.php deleted file mode 100644 index bfd2aae..0000000 --- a/code/database/seeders/VideoInfoSeeder.php +++ /dev/null @@ -1,318 +0,0 @@ - '阿凡达', 'v_ticket_sales' => 206.69], - ['v_name' => '复仇者联盟4:终局之战', 'v_ticket_sales' => 203.15], - ['v_name' => '阿凡达:水之道', 'v_ticket_sales' => 168.25], - ['v_name' => '泰坦尼克号', 'v_ticket_sales' => 161.58], - ['v_name' => '哪吒之魔童闹海', 'v_ticket_sales' => 145], - ['v_name' => '星球大战7:原力觉醒', 'v_ticket_sales' => 143.69], - ['v_name' => '复仇者联盟3:无限战争', 'v_ticket_sales' => 136.78], - ['v_name' => '蜘蛛侠:英雄无归', 'v_ticket_sales' => 130.20], - ['v_name' => '侏罗纪世界', 'v_ticket_sales' => 129.95], - ['v_name' => '狮子王(2019)', 'v_ticket_sales' => 118.23], - ['v_name' => '复仇者联盟', 'v_ticket_sales' => 117.94], - ['v_name' => '速度与激情7', 'v_ticket_sales' => 116.24], - ['v_name' => '冰雪奇缘2', 'v_ticket_sales' => 114.54], - ['v_name' => '复仇者联盟2:奥创纪元', 'v_ticket_sales' => 112.57], - ['v_name' => '黑豹', 'v_ticket_sales' => 110.45], - - ['v_name' => '哈利·波特与死亡圣器(下)', 'v_ticket_sales' => 108.34], - ['v_name' => '超人总动员2', 'v_ticket_sales' => 106.82], - ['v_name' => '速度与激情8', 'v_ticket_sales' => 104.85], - ['v_name' => '美女与野兽(2017)', 'v_ticket_sales' => 103.76], - ['v_name' => '小黄人大眼萌', 'v_ticket_sales' => 101.75], - ['v_name' => '钢铁侠3', 'v_ticket_sales' => 98.99], - ['v_name' => '海王', 'v_ticket_sales' => 96.45], - ['v_name' => '美国队长3:内战', 'v_ticket_sales' => 95.78], - ['v_name' => '变形金刚4:绝迹重生', 'v_ticket_sales' => 94.63], - ['v_name' => '哈利·波特与魔法石', 'v_ticket_sales' => 93.58], - ['v_name' => '蜘蛛侠:英雄归来', 'v_ticket_sales' => 92.47], - ['v_name' => '蝙蝠侠:黑暗骑士', 'v_ticket_sales' => 91.23], - ['v_name' => '超凡蜘蛛侠', 'v_ticket_sales' => 90.15], - ['v_name' => '星球大战8:最后的绝地武士', 'v_ticket_sales' => 89.78], - ['v_name' => '冰雪奇缘', 'v_ticket_sales' => 88.69], - ['v_name' => '星球大战9:天行者崛起', 'v_ticket_sales' => 87.45], - ['v_name' => '小丑', 'v_ticket_sales' => 86.12], - ]; - - foreach ($arrData as $arrDataOne) { - $VideoInfoModel = VideoInfoModel::where('v_name', $arrDataOne['v_name'])->find(); - if (!empty($VideoInfoModel)) { - try { - $VideoInfoModel->v_ticket_sales = $arrDataOne['v_ticket_sales']; - $VideoInfoModel->save(); - } catch (\Exception $e) { - echo "Error: " . $e->getMessage(); - } - - } - } - self::updateVideo(); - self::updateNovel(); - - - } - - static public function updateVideo() - { - /* - - 推荐 - */ - $arrData = [ - ['v_name' => '遮天'], - ['v_name' => '滤镜'], - ['v_name' => '战狼'], - ['v_name' => '战狼2'], - ['v_name' => '天道'], - ['v_name' => '黑冰'], - ['v_name' => '长城'], - ['v_name' => '异型'], - ['v_name' => '滴滴代驾'], - ['v_name' => '我靠鉴宝走向人生巅峰'], - ['v_name' => '我叫苏妲己'], - ['v_name' => '九州战神'], - ['v_name' => '仙逆'], - ['v_name' => '似锦'], - ['v_name' => '斗破苍穹'], - ['v_name' => '庆余年'], - ['v_name' => '庆余年第二季'], - ['v_name' => '繁花'], - ['v_name' => '玫瑰的故事'], - ['v_name' => '大奉打更人'], - ['v_name' => '县委大院'], - ['v_name' => '三国演义'], - ['v_name' => '三体'], - ['v_name' => '鬼吹灯'], - ['v_name' => '云顶天宫'], - ['v_name' => '盗墓笔记'], - ['v_name' => '家有儿女'], - ['v_name' => '湄公河大案'], - ['v_name' => '亮剑'], - ['v_name' => '爱情公寓'], - ['v_name' => '爱情公寓2'], - ['v_name' => '爱情公寓3'], - ['v_name' => '我叫王土地'], - ['v_name' => '唐人街探索案'], - ['v_name' => '唐人街探索案2'], - ['v_name' => '唐人街探索案3'], - ['v_name' => '749局'], - ['v_name' => '红海行动'], - ['v_name' => '僵尸叔叔'], - ['v_name' => '哈利·波特与死亡圣器(下'], - ['v_name' => '超人总动员2'], - ['v_name' => '速度与激情8'], - ['v_name' => '美女与野兽(2017)'], - ['v_name' => '小黄人大眼萌'], - ['v_name' => '钢铁侠3'], - ['v_name' => '毒液'], - ['v_name' => '海王'], - ['v_name' => '美国队长3:内战'], - ['v_name' => '变形金刚4:绝迹重生'], - ['v_name' => '哈利·波特与魔法石'], - ['v_name' => '蜘蛛侠:英雄归来'], - ['v_name' => '蝙蝠侠:黑暗骑士'], - ['v_name' => '超凡蜘蛛侠'], - ['v_name' => '星球大战8:最后的绝地武士'], - ['v_name' => '冰雪奇缘'], - ['v_name' => '星球大战9:天行者崛起'], - ['v_name' => '小丑'], - ['v_name' => '阿凡达'], - ['v_name' => '复仇者联盟4:终局之战'], - ['v_name' => '阿凡达:水之道'], - ['v_name' => '泰坦尼克号'], - ['v_name' => '哪吒之魔童闹海'], - ['v_name' => '星球大战7:原力觉醒'], - ['v_name' => '复仇者联盟3:无限战争'], - ['v_name' => '蜘蛛侠:英雄无归'], - ['v_name' => '侏罗纪世界'], - ['v_name' => '狮子王(2019)'], - ['v_name' => '复仇者联盟'], - ['v_name' => '速度与激情7'], - ['v_name' => '冰雪奇缘2'], - ['v_name' => '复仇者联盟2:奥创纪元'], - ['v_name' => '黑豹'], - ['v_name' => '六姊妹'], - ['v_name' => '侏罗纪世界3'], - ['v_name' => '唐伯虎点点秋香'], - ['v_name' => '欢乐颂'], - ['v_name' => '人再囧途之泰囧'], - ['v_name' => '囧途'], - ['v_name' => '速度与激情10'], - ['v_name' => '绝地战警:生死与共'], - ['v_name' => '毒液:最后一舞'], - ['v_name' => '食神'], - ['v_name' => '终极代码'], - ['v_name' => '终极代码'], - ['v_name' => '前任4:英年早婚'], - ['v_name' => '前任3:再见前任​'], - ['v_name' => '前任2:备胎反击战​'], - ['v_name' => '前任攻略​'], - ['v_name' => '下一任:前任'], - ['v_name' => '诡迷心笑'], - ['v_name' => '城中之城​'], - ['v_name' => '精英律师'], - ['v_name' => '走走停停​'], - ['v_name' => '猎场'], - ['v_name' => '深海狂鲨2'], - ]; - - foreach ($arrData as $arrDataOne) { - $VideoInfoModel = VideoInfoModel::where('v_name', $arrDataOne['v_name'])->find(); - if (!empty($VideoInfoModel)) { - try { - $VideoInfoModel->v_recommend = 9; - $VideoInfoModel->save(); - } catch (\Exception $e) { - echo "Error: " . $e->getMessage(); - } - - } - } - - - } - - static public function updateNovel(){ - $arrData = [ - ['xsxq_ming_zi' => '遮天', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '完美世界', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '圣墟', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '斗破苍穹', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '武动乾坤', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '大主宰', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '雪中悍刀行', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '择天记', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '凡人修仙传', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '仙逆', 'xsxq_tui_jian' => 1], - - ['xsxq_ming_zi' => '人间有剑', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '步步高升:从省考状元到权力巅峰', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '源力过载', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '天下长宁', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '剑来', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '捞尸人', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '轮回乐园', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '没钱修什么仙?', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '夜无疆', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '谁让他盛世美颜', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '牧神记', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '吞噬星空', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '全家偷听我心声杀疯了,我负责吃奶', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '盖世神医', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '太荒吞天诀', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '不朽剑神', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '乾坤剑神', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '帝武丹尊', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '都市武圣', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '我们的火红年代', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '利欲升迁记', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '做局', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '巅峰权力', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '狂少下山', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '对手', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '人间政道', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '官道之绝对权力', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '我的透视超给力', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '穿书七零:作精女配她暴富了', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '长生仙游', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '分手后我成了前任他小婶', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '农门长姐:我娇养了五个哥哥', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '龙血战神', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '修罗武神', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '穿到三千小世界里当炮灰', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '女总裁的全能兵王', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '九星霸体诀', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '天官赐福', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '全球高考', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '撒野', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '修罗武神', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '人皇纪', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '万古仙穹', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '元尊', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '妙医鸿途', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '最强逆袭', 'xsxq_tui_jian' => 1], - ['xsxq_ming_zi' => '重生之国民男神', 'xsxq_tui_jian' => 1], - - - ]; - - foreach ($arrData as $arrDataOne) { - $XiaoShuoXiangQingModel = XiaoShuoXiangQingModel::where('xsxq_ming_zi', $arrDataOne['xsxq_ming_zi'])->find(); - if (!empty($XiaoShuoXiangQingModel)) { - try { - $XiaoShuoXiangQingModel->xsxq_tui_jian = $arrDataOne['xsxq_tui_jian']; - $XiaoShuoXiangQingModel->save(); - } catch (\Exception $e) { - echo "Error: " . $e->getMessage(); - } - - } - } - } -} - diff --git a/code/database/seeders/VideoSeoSeeder.php b/code/database/seeders/VideoSeoSeeder.php deleted file mode 100644 index d4e68b2..0000000 --- a/code/database/seeders/VideoSeoSeeder.php +++ /dev/null @@ -1,35 +0,0 @@ - '哪吒2', - 'v_id' => '33572', - ], - [ - 'vis_name' => '哪吒之魔童闹海票房', - 'v_id' => '33572', - ], - [ - 'vis_name' => '哪吒之魔童闹海最新票房', - 'v_id' => '33572', - ], - ]; - - foreach ($arrData as $arrDataOne) { - $arrDataOne['vis_md5'] = md5($arrDataOne['vis_name'] . $arrDataOne['v_id']); - $VideoInfoSeoModel = VideoInfoSeoModel::where('vis_md5', $arrDataOne['vis_md5'])->find(); - if (empty($VideoInfoSeoModel)) { - VideoInfoSeoModel::insert($arrDataOne); - } - } - } -} diff --git a/code/extend/SeoTdkHelper.php b/code/extend/SeoTdkHelper.php deleted file mode 100644 index ceb0fc2..0000000 --- a/code/extend/SeoTdkHelper.php +++ /dev/null @@ -1,37 +0,0 @@ - $strSiteName, - '{{{site_domain}}}' => $strDomain, - ], $extraReplacements); - - // 替换 - $strTdkTitle = strtr($strTdkTitle, $replacements); - $strTdkKeywords = strtr($strTdkKeywords, $replacements); - $strTdkDescription = strtr($strTdkDescription, $replacements); - - return [ - 'strTdkTitle' => $strTdkTitle, - 'strTdkKeywords' => $strTdkKeywords, - 'strTdkDescription' => $strTdkDescription, - ]; - } -} diff --git a/code/extend/storage/StorageCore.php b/code/extend/storage/StorageCore.php new file mode 100644 index 0000000..62a5ae2 --- /dev/null +++ b/code/extend/storage/StorageCore.php @@ -0,0 +1,84 @@ +Adapter = new Local( + $arrConfig['local']['dir'] + ); + + $this->Filesystem = new Filesystem($this->Adapter); + } + + /** + * Undocumented function + * + * @return self + */ + public static function getInstance(): self + { + if (self::$instance == null) { + self::$instance = new self(); + } + return self::$instance; + } + + public function set($strKey, $strContent) + { + $strContent = zstd_compress($strContent); + return $this->Filesystem->write($strKey, $strContent); + } + + + public function write($strKey, $strContent, array $arrConfig = []) + { + $strContent = zstd_compress($strContent); + return $this->Filesystem->write($strKey, $strContent, $arrConfig); + } + + public function update($strKey, $strContent, array $arrConfig = []) + { + $strContent = zstd_compress($strContent); + return $this->Filesystem->update($strKey, $strContent, $arrConfig); + } + + public function read($strKey) + { + $Stream = $this->Filesystem->readStream($strKey); + $strContent = stream_get_contents($Stream); + $strContent = zstd_uncompress($strContent); + return $strContent; + } + + public function has($strKey) + { + return $this->Filesystem->has($strKey); + } +}