设计url
This commit is contained in:
@@ -2,63 +2,80 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use app\home\controller\Index;
|
||||
use app\home\controller\Novel;
|
||||
use app\home\controller\User;
|
||||
use think\facade\Route;
|
||||
|
||||
# 路由别名,可以忽略
|
||||
// Route::alias("/index.html", "/")->append(['boolIsMobile' => true]);
|
||||
// Route::alias("/pc/index.html", "/")->append(['boolIsMobile' => false]);
|
||||
|
||||
Route::get("/", 'Index/index')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/index", 'Index/index')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/index", 'Index/getPcIndex')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get("/pc/", 'Index/getPcIndex')->append(['boolIsMobile' => false]);
|
||||
Route::get("/", [Index::class,'index'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/index", [Index::class,'index'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/index", [Index::class,'getPcIndex'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get("/pc/", [Index::class,'getPcIndex'])->append(['boolIsMobile' => false]);
|
||||
|
||||
// 书架
|
||||
Route::get('bookshelf', 'User/getBookShelf')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/bookshelf', 'User/getBookShelf')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('bookshelf', [User::class,'getBookShelf'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/bookshelf', [User::class,'getBookShelf'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
//排行榜
|
||||
Route::get('rank', 'Novel/getNovelRank')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/rank", 'Novel/getNovelRank')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('paihang', [Novel::class,'getNovelRank'])->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/paihang", [Novel::class,'getNovelRank'])->append(['boolIsMobile' => false]);
|
||||
|
||||
// 男生/女生-grok 推荐最优方案
|
||||
Route::get('nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'girls']);
|
||||
Route::get('pc/nvsheng-xiaoshuo', [Novel::class, 'getNovelgetNovelChannelInfo'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']);
|
||||
// 男生/女生 - grok 推荐最优方案
|
||||
Route::get('/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']);
|
||||
Route::get('/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']);
|
||||
Route::get('/pc/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']);
|
||||
Route::get('/pc/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']);
|
||||
|
||||
// 书库 - grok 推荐最优方案 /shuku/channel-category-status-page
|
||||
Route::get('/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => false]);
|
||||
Route::get('/shuku/:strNovelChannel-:strCategory-:strStatus-:intPage', [Novel::class,'getLibrary'])
|
||||
->pattern([
|
||||
'strNovelChannel' => '[\w]*',
|
||||
'strCategory' => '[\w]*',
|
||||
'strStatus' => '[\w]*',
|
||||
'intPage' => '\d+'
|
||||
])
|
||||
->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/shuku/:strNovelChannel-:strCategory-:strStatus-:intPage', [Novel::class,'getLibrary'])
|
||||
->pattern([
|
||||
'strNovelChannel' => '[\w]*',
|
||||
'strCategory' => '[\w]*',
|
||||
'strStatus' => '[\w]*',
|
||||
'intPage' => '\d+'
|
||||
])
|
||||
->append(['boolIsMobile' => false]);
|
||||
|
||||
|
||||
//分类
|
||||
Route::get('class', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/class', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// //分类 使用模板:xmttxs
|
||||
// Route::get('/books', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]);
|
||||
// Route::get('/pc/books', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => false]);
|
||||
// Route::get('/books/[:intCategoryId]-[:intPage]', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/fenlei/<intCategoryId]-[:intPage]', 'Novel/getNovelCategory')
|
||||
->append(['boolIsMobile' => false])
|
||||
->pattern(['intCategoryId' => '\d+','intPage' => '\d+',])
|
||||
->ext('html');
|
||||
// Route::get('class', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]);
|
||||
// Route::get('/pc/class', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => false]);
|
||||
// // //分类 使用模板:xmttxs
|
||||
// // Route::get('/books', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]);
|
||||
// // Route::get('/pc/books', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => false]);
|
||||
// // Route::get('/books/[:intCategoryId]-[:intPage]', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]);
|
||||
// Route::get('/pc/fenlei/<intCategoryId]-[:intPage]', 'Novel/getNovelCategory')
|
||||
// ->append(['boolIsMobile' => false])
|
||||
// ->pattern(['intCategoryId' => '\d+','intPage' => '\d+',])
|
||||
// ->ext('html');
|
||||
|
||||
|
||||
|
||||
|
||||
// 书库
|
||||
Route::get('/library', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/library", 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/shuku', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/shuku', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/shuku/[:strNovelChannel]-[:intCategoryId]-[:strStatus]-[:intPage]', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/shuku/[:strNovelChannel]-[:intCategoryId]-[:strStatus]-[:intPage]', 'Novel/getLibrary')->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 文章 列表
|
||||
Route::get('/article/list-[:intCategoryId]-[:intPage]', 'Novel/getArticleList')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/list-[:intCategoryId]-[:intPage]', 'Novel/getArticleList')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/article/list', 'Novel/getArticleList')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/list', 'Novel/getArticleList')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/article/list-[:intCategoryId]-[:intPage]', [Novel::class,'getArticleList'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/list-[:intCategoryId]-[:intPage]', [Novel::class,'getArticleList'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/article/list', [Novel::class,'getArticleList'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/list', [Novel::class,'getArticleList'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 文章 详情
|
||||
Route::get('/article/info-:intArticleId', 'Novel/getArticleInfo')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/info-:intArticleId', 'Novel/getArticleInfo')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
|
||||
// 小说详情
|
||||
@@ -103,23 +120,23 @@ Route::get('/pc/chapter/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/get
|
||||
Route::get('/pc/books/:intNovelId-:intChapterId-[:intChapterPage]', 'Novel/getNovelChapter')->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 小说目录
|
||||
Route::get('/chapters/:intNovelId-[:intPage]-[:strSort]', 'Novel/getNovelChapterAll')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('pc/chapters/:intNovelId-[:intPage]-[:strSort]', 'Novel/getNovelChapterAll')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/chapters', 'Novel/getNovelChapterAll')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('pc/chapters', 'Novel/getNovelChapterAll')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/chapters/:intNovelId-[:intPage]-[:strSort]', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('pc/chapters/:intNovelId-[:intPage]-[:strSort]', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/chapters', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('pc/chapters', [Novel::class,'getNovelChapterAll'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
|
||||
// 搜索小说
|
||||
Route::get('search', 'Novel/getSearchNovel')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('pc/search', 'Novel/getSearchNovel')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('pc/search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 小说用户中心
|
||||
Route::get('/user', 'User/Index')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/user', 'User/Index')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/user', [User::class,'Index'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/user', [User::class,'Index'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 历史记录
|
||||
Route::get('history', 'User/getHistory')->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/history', 'User/getHistory')->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('history', [User::class,'getHistory'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/history', [User::class,'getHistory'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
|
||||
|
||||
@@ -154,112 +171,112 @@ Route::get('/pc/history', 'User/getHistory')->ext('html')->append(['boolIsMobile
|
||||
// $arrRoutes = [
|
||||
// # 小说推荐
|
||||
// [
|
||||
// 'class'=>'Novel/getRankList',
|
||||
// 'class'=>[Novel::class,'getRankList'],
|
||||
// 'name'=>'Novel@getTuijianList',
|
||||
// 'path'=>[
|
||||
// '/tj/:intTjdj-[:intPage]',
|
||||
// '/tuijian/:intTjdj-[:intPage]',
|
||||
// '/recommend/:intTjdj-[:intPage]',
|
||||
// '/nice/:intTjdj-[:intPage]',
|
||||
// '/good/:intTjdj-[:intPage]',
|
||||
// '/推荐/:intTjdj-[:intPage]',
|
||||
// [::class,'tj/:intTjdj-[:intPage]'],
|
||||
// [::class,'tuijian/:intTjdj-[:intPage]'],
|
||||
// [::class,'recommend/:intTjdj-[:intPage]'],
|
||||
// [::class,'nice/:intTjdj-[:intPage]'],
|
||||
// [::class,'good/:intTjdj-[:intPage]'],
|
||||
// [::class,'推荐/:intTjdj-[:intPage]'],
|
||||
// ],
|
||||
// ],
|
||||
// # 小说分类
|
||||
// [
|
||||
// 'class'=>'Novel/getCategoryList',
|
||||
// 'class'=>[Novel::class,'getCategoryList'],
|
||||
// 'name'=>'Novel@getCategoryList',
|
||||
// 'path'=>[
|
||||
// '/list/:intCId-:intSort-:intStatus-[:intPage]',
|
||||
// '/fenlei/:intCId-:intSort-:intStatus-[:intPage]',
|
||||
// '/class/:intCId-:intSort-:intStatus-[:intPage]',
|
||||
// '/type/:intCId-:intSort-:intStatus-[:intPage]',
|
||||
// '/leixin/:intCId-:intSort-:intStatus-[:intPage]',
|
||||
// '/小说分类/:intCId-:intSort-:intStatus-[:intPage]',
|
||||
// [::class,'list/:intCId-:intSort-:intStatus-[:intPage]'],
|
||||
// [::class,'fenlei/:intCId-:intSort-:intStatus-[:intPage]'],
|
||||
// [::class,'class/:intCId-:intSort-:intStatus-[:intPage]'],
|
||||
// [::class,'type/:intCId-:intSort-:intStatus-[:intPage]'],
|
||||
// [::class,'leixin/:intCId-:intSort-:intStatus-[:intPage]'],
|
||||
// [::class,'小说分类/:intCId-:intSort-:intStatus-[:intPage]'],
|
||||
// ],
|
||||
// ],
|
||||
// # 小说排行
|
||||
// [
|
||||
// 'class'=>'Novel/getNovelRankList',
|
||||
// 'class'=>[Novel::class,'getNovelRankList'],
|
||||
// 'name'=>'Novel@getNovelRankList',
|
||||
// 'path'=>[
|
||||
// '/paihang/:intCId-:intSort-[:intPage]',
|
||||
// '/paihanbang/:intCId-:intSort-[:intPage]',
|
||||
// '/rank/:intCId-:intSort-[:intPage]',
|
||||
// '/sort/:intCId-:intSort-[:intPage]',
|
||||
// '/pb/:intCId-:intSort-[:intPage]',
|
||||
// '/排行榜/:intCId-:intSort-[:intPage]',
|
||||
// [::class,'paihang/:intCId-:intSort-[:intPage]'],
|
||||
// [::class,'paihanbang/:intCId-:intSort-[:intPage]'],
|
||||
// [::class,'rank/:intCId-:intSort-[:intPage]'],
|
||||
// [::class,'sort/:intCId-:intSort-[:intPage]'],
|
||||
// [::class,'pb/:intCId-:intSort-[:intPage]'],
|
||||
// [::class,'排行榜/:intCId-:intSort-[:intPage]'],
|
||||
// ],
|
||||
// ],
|
||||
|
||||
// # 小说章节
|
||||
// [
|
||||
// 'class'=>'Novel/getReader',
|
||||
// 'class'=>[Novel::class,'getReader'],
|
||||
// 'name'=>'Novel@getReader',
|
||||
// 'path'=>[
|
||||
// '/xq/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/xiaoshuo/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/novel/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/info/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/shu/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/小说/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// [::class,'xq/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'xiaoshuo/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'novel/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'info/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'shu/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'小说/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
|
||||
// '/book/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/kan/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/show/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/yuedu/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/see/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// '/相关/:intNovelId/:intZhangJiePaiXu-[:strSort]',
|
||||
// [::class,'book/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'kan/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'show/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'yuedu/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'see/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// [::class,'相关/:intNovelId/:intZhangJiePaiXu-[:strSort]'],
|
||||
// ],
|
||||
// ],
|
||||
|
||||
// # 小说详情
|
||||
// [
|
||||
// 'class'=>'Novel/getDetail',
|
||||
// 'class'=>[Novel::class,'getDetail'],
|
||||
// 'name'=>'Novel@getDetail',
|
||||
// 'path'=>[
|
||||
// '/xq/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/xiaoshuo/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/novel/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/info/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/shu/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/小说/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// [::class,'xq/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'xiaoshuo/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'novel/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'info/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'shu/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'小说/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
|
||||
// '/book/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/kan/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/show/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/yuedu/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/see/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// '/相关/:intNovelId-[:intCurrentPage]-[:strSort]',
|
||||
// [::class,'book/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'kan/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'show/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'yuedu/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'see/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// [::class,'相关/:intNovelId-[:intCurrentPage]-[:strSort]'],
|
||||
// ],
|
||||
// ],
|
||||
// # 搜索 - 小说
|
||||
// [
|
||||
// 'class'=>'Search/getNovel',
|
||||
// [class'=>'Search::class,'getNovel'],
|
||||
// 'name'=>'Search@getNovel',
|
||||
// 'path'=>[
|
||||
// '/search',
|
||||
// [::class,'search'],
|
||||
// ],
|
||||
// ],
|
||||
// # 书架
|
||||
// [
|
||||
// 'class'=>'Search/getShujia',
|
||||
// 'name'=>'Search/getShujia',
|
||||
// [class'=>'Search::class,'getShujia'],
|
||||
// [name'=>'Search::class,'getShujia'],
|
||||
// 'path'=>[
|
||||
// '/shujia',
|
||||
// [::class,'shujia'],
|
||||
// ],
|
||||
// ],
|
||||
// # 收藏
|
||||
// [
|
||||
// 'class'=>'Search/addSc',
|
||||
// 'name'=>'Search/addSc',
|
||||
// [class'=>'Search::class,'addSc'],
|
||||
// [name'=>'Search::class,'addSc'],
|
||||
// 'path'=>[
|
||||
// '/sc',
|
||||
// [::class,'sc'],
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
|
||||
// // Route::get('/sc', 'Novel/addSc')
|
||||
// // Route::get('/sc', [Novel::class,'addSc'])
|
||||
// // ->middleware('Throttle:5,60') // 限制 1 分钟内最多 5 次
|
||||
// // ->name('Novel@addSc');
|
||||
|
||||
|
||||
@@ -115,7 +115,8 @@ class Index extends BaseController
|
||||
|
||||
/**
|
||||
* 首页数据-PC
|
||||
*
|
||||
* @param Request $Request
|
||||
* @return void
|
||||
*/
|
||||
public function getPcIndex(Request $Request)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace app\home\controller;
|
||||
|
||||
use app\home\BaseController;
|
||||
use app\model\NovelModel;
|
||||
use storage\StorageCore;
|
||||
use think\facade\View;
|
||||
use app\Request;
|
||||
@@ -119,26 +120,39 @@ class Novel extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
// 书库 [:strNovelChannel]-[:intCategoryId]-[:strStatus]-[:strTextNumber]-[:strUpdateTime]-[:strSort]
|
||||
public function getLibrary(Request $Request, $strNovelChannel = null, $intCategoryId = null, $strStatus = null, $strTextNumber = null, $strUpdateTime = null, $strSort = null, $intPage = 1)
|
||||
/**
|
||||
* 书库
|
||||
*
|
||||
* @param Request $Request
|
||||
* @param [type] $strNovelChannel 男生/女生 -拼音
|
||||
* @param [type] $strCategory 分类 -拼音
|
||||
* @param [type] $strStatus 连载/完结 -拼音
|
||||
* @param integer $intPage 分页
|
||||
* @return void
|
||||
*/
|
||||
public function getLibrary(Request $Request, $strNovelChannel = 'all', $strCategory = 'all', $strStatus = 'all',$intPage = 1)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
|
||||
// 模拟数据
|
||||
$arrNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
['id' => 2, 'name' => '小说2', 'author' => '作者2'],
|
||||
['id' => 3, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 4, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 5, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
['n_id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
['n_id' => 2, 'name' => '小说2', 'author' => '作者2'],
|
||||
['n_id' => 3, 'name' => '小说3', 'author' => '作者3'],
|
||||
['n_id' => 4, 'name' => '小说3', 'author' => '作者3'],
|
||||
['n_id' => 5, 'name' => '小说3', 'author' => '作者3'],
|
||||
['n_id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['n_id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['n_id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
];
|
||||
|
||||
View::assign([
|
||||
'arrNovel' => $arrNovel,
|
||||
'strPageCode' => 'library'
|
||||
'strPageCode' => 'library',
|
||||
'strNovelChannel' => $strNovelChannel,
|
||||
'strCategory' => $strCategory,
|
||||
'strStatus' => $strStatus,
|
||||
'intPage' => $intPage,
|
||||
]);
|
||||
if ($boolIsMobile) {
|
||||
return View::fetch();
|
||||
@@ -175,68 +189,44 @@ class Novel extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
// 男生女生频道
|
||||
/**
|
||||
* 男生女生频道
|
||||
*
|
||||
* @param Request $Request
|
||||
* @return void
|
||||
*/
|
||||
public function getNovelChannel(Request $Request)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
$strNovelChannel = $Request->param('strChannel'); // 区分男生/女生频道
|
||||
|
||||
// 模拟数据-推荐等级为9的,连载的,男生频道/女生频道, 随机12个小说
|
||||
$arrRecommendSerializationNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
['id' => 2, 'name' => '小说2', 'author' => '作者2'],
|
||||
['id' => 3, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 4, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 5, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 9, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 10, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 11, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 12, 'name' => '小说3', 'author' => '作者3'],
|
||||
];
|
||||
// 模拟数据-推荐等级为9的,完结的,男生频道/女生频道, 随机8个小说
|
||||
$arrRecommendEndNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
['id' => 2, 'name' => '小说2', 'author' => '作者2'],
|
||||
['id' => 3, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 4, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 5, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
$NovelModel = new NovelModel;
|
||||
$intType = ['boys' => 1, 'girls' => 2][$strNovelChannel];
|
||||
$intLifeTime = 24 * 3600;
|
||||
|
||||
];
|
||||
// 推荐等级为9的,连载的,男生频道/女生频道, 随机12个小说
|
||||
$strKey = sprintf('%s:PC:Novel:Channel:Hot:%s:%s', $Request->DomainModel->d_domain, $intType, 'Serialized');
|
||||
$intCount = 12;
|
||||
$strStuatus = '连载中';
|
||||
|
||||
$arrRecommendSerializationNovel = $NovelModel->getCommonNovelOnCache($strKey, $intLifeTime, $intCount, $intType, $strStuatus);
|
||||
|
||||
// 推荐等级为9的,完结的,男生频道/女生频道, 随机8个小说
|
||||
$strKey = sprintf('%s:PC:Novel:Channel:Hot:%s:%s', $Request->DomainModel->d_domain, $intType, 'Finish');
|
||||
$intCount = 8;
|
||||
$strStuatus = '完结';
|
||||
|
||||
$arrRecommendEndNovel = $NovelModel->getCommonNovelOnCache($strKey, $intLifeTime, $intCount, $intType, $strStuatus);
|
||||
|
||||
// 模拟数据-最近更新-随机50
|
||||
$arrNewsUpdateNovel = [
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
['id' => 2, 'name' => '小说2', 'author' => '作者2'],
|
||||
['id' => 3, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 4, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 5, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 9, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 10, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 1, 'name' => '小说1', 'author' => '作者1'],
|
||||
['id' => 2, 'name' => '小说2', 'author' => '作者2'],
|
||||
['id' => 3, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 4, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 5, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 6, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 7, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 8, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 9, 'name' => '小说3', 'author' => '作者3'],
|
||||
['id' => 10, 'name' => '小说3', 'author' => '作者3'],
|
||||
];
|
||||
|
||||
$strKey = sprintf('%s:PC:Novel:Channel:Latest:%s', $Request->DomainModel->d_domain, $intType);
|
||||
$intCount = 20;
|
||||
$arrNewsUpdateNovel = $NovelModel->getCommonNovelOnCache($strKey, $intLifeTime, $intCount, $intType, NULL, ['og_novel_update_time' => -1]);
|
||||
|
||||
View::assign([
|
||||
'arrNewsUpdateNovel' => $arrNewsUpdateNovel,
|
||||
'arrRecommendSerializationNovel' => $arrRecommendSerializationNovel,
|
||||
'arrRecommendEndNovel' => $arrRecommendEndNovel,
|
||||
'arrNewsUpdateNovel' => $arrNewsUpdateNovel,
|
||||
'arrAdBanner' => [],
|
||||
'strPageCode' => $strNovelChannel
|
||||
]);
|
||||
@@ -248,7 +238,7 @@ class Novel extends BaseController
|
||||
}
|
||||
|
||||
// 分类
|
||||
public function getNovelCategory(Request $Request,$intCategoryId = null ,$intPage = 1)
|
||||
public function getNovelCategory(Request $Request, $intCategoryId = null, $intPage = 1)
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
$strChannel = $Request->param('strChannel'); // 区分男生 / 女生频道
|
||||
@@ -426,7 +416,7 @@ class Novel extends BaseController
|
||||
}
|
||||
|
||||
// 小说章节-所有章节
|
||||
public function getNovelChapterAll(Request $Request,$intNovelId=null,$intPage=1,$strSort='asc')
|
||||
public function getNovelChapterAll(Request $Request, $intNovelId = null, $intPage = 1, $strSort = 'asc')
|
||||
{
|
||||
$boolIsMobile = $Request->param('boolIsMobile');
|
||||
// 模拟数据
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<li>
|
||||
<a href='/pc{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}' title="{$Novel->og_novel_book_name}" target="_blank" class="book_cov">
|
||||
<a href='/pc{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}' title="{$Novel->og_novel_book_name ?? ''}" target="_blank" class="book_cov">
|
||||
<img class="lazyload_book_cover lazyload-img"
|
||||
src="/static/img/default.jpg" data-src="{$Novel->n_cover_path}"
|
||||
alt="{$Novel->og_novel_book_name}">
|
||||
src="/static/img/default.jpg" data-src="{$Novel->n_cover_path ?? ''}"
|
||||
alt="{$Novel->og_novel_book_name ?? ''}">
|
||||
</a>
|
||||
<div class="book_inf">
|
||||
<h3><a href='/pc{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}' title="{$Novel->og_novel_book_name}" target="_blank">{$Novel->og_novel_book_name}</a></h3>
|
||||
<span class="aut">{$Novel->og_novel_author}</span>
|
||||
<h3><a href='/pc{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}' title="{$Novel->og_novel_book_name ?? ''}" target="_blank">{$Novel->og_novel_book_name ?? ''}</a></h3>
|
||||
<span class="aut">{$Novel->og_novel_author ?? ''}</span>
|
||||
</div>
|
||||
</li>
|
||||
@@ -1,5 +1,5 @@
|
||||
<li>
|
||||
<a href='/pc{site:nurl n_id="$Novel->n_id" n_py="$Novel->og_novel_pin_yin"/}' target="_blank" class="book_cov" title="{$Novel->og_novel_book_name ?? ''}">
|
||||
<a href='/pc{site:nurl n_id="$Novel->n_id ?? 1" n_py="$Novel->og_novel_pin_yin"/}' target="_blank" class="book_cov" title="{$Novel->og_novel_book_name ?? ''}">
|
||||
<img class="lazyload_book_cover lazyload-img"
|
||||
src="/static/img/default.jpg" data-src="{$Novel.n_cover_path ?? ''}" alt="{$Novel->og_novel_book_name ?? ''}">
|
||||
</a>
|
||||
|
||||
@@ -6,66 +6,31 @@
|
||||
|
||||
{block name="main"}
|
||||
<div class="content">
|
||||
<!--选择搜索 开始-->
|
||||
<!--选择搜索 开始-->
|
||||
<div class="find">
|
||||
<div class="opt">
|
||||
<div class="optCl" mod="search_channel">
|
||||
<span class="optTit">所属频道</span>
|
||||
<ul>
|
||||
<li><a class="on" href="/pc/shuku.html" btn="search_category">全部</a></li>
|
||||
<li><a href="/pc/shuku/boys------.html" btn="search_category">男生</a></li>
|
||||
<li><a href="/pc/shuku/girls------.html" btn="search_category">女生</a></li>
|
||||
<li><a class="on" href="/pc/shuku/all-{$strCategory}-{$strStatus}-1.html" btn="search_category">全部</a></li>
|
||||
<li><a href="/pc/shuku/nansheng-{$strCategory}-{$strStatus}-1.html" btn="search_category">男生</a></li>
|
||||
<li><a href="/pc/shuku/nvsheng-{$strCategory}-{$strStatus}-1.html" btn="search_category">女生</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="optCl" mod="search_channel">
|
||||
<span class="optTit">所属分类</span>
|
||||
<ul>
|
||||
<li><a class="on" href="/pc/shuku.html" btn="search_category">全部</a></li>
|
||||
<li><a href="/pc/shuku/-1-----.html" btn="search_category">都市修仙</a></li>
|
||||
<li><a href="/pc/shuku/-2-----.html" btn="search_category">玄幻修真</a></li>
|
||||
<li><a href="/pc/shuku/-3-----.html" btn="search_category">玄幻修真</a></li>
|
||||
<li><a href="/pc/shuku/-4-----.html" btn="search_category">玄幻修真</a></li>
|
||||
<!-- <li><a href="/pc/shuku/-intCategoryId-strStatus-strTextNumber-strUpdateTime-strSort-intPage.html" btn="search_category">玄幻修真</a></li> -->
|
||||
<li><a class="on" href="/pc/shuku/{$strNovelChannel}-all-{$strStatus}-1.html" btn="search_category">全部</a></li>
|
||||
<li><a href="/pc/shuku/{$strNovelChannel}-dushixiuxian-{$strStatus}-1.html" btn="search_category">都市修仙</a></li>
|
||||
<li><a href="/pc/shuku/{$strNovelChannel}-xuanhuanxiuzhen-{$strStatus}-1.html" btn="search_category">玄幻修真</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="optCl">
|
||||
<span class="optTit">是否完结</span>
|
||||
<ul>
|
||||
<li><a class="on" href="/pc/shuku.html" btn="search_category">全部</a></li>
|
||||
<li><a href="/pc/shuku/--update----.html" btn="search_category">连载</a></li>
|
||||
<li><a href="/pc/shuku/--end----.html" btn="search_category">完本</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="optCl">
|
||||
<span class="optTit">作品字数</span>
|
||||
<ul>
|
||||
<li><a class="on" href="/pc/shuku.html" btn="search_category">全部</a></li>
|
||||
<li><a href="/pc/shuku/---30---.html" btn="search_category">30万字以下</a></li>
|
||||
<li><a href="/pc/shuku/---50---.html" btn="search_category">30-50万字</a></li>
|
||||
<li><a href="/pc/shuku/---100---.html" btn="search_category">50-100万字</a></li>
|
||||
<li><a href="/pc/shuku/---200---.html" btn="search_category">100-200万字</a></li>
|
||||
<li><a href="/pc/shuku/---201---.html" btn="search_category">200万字以上</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="optCl">
|
||||
<span class="optTit">更新时间</span>
|
||||
<ul>
|
||||
<li><a class="on" href="/pc/shuku.html" btn="search_category">全部</a></li>
|
||||
<li><a href="/pc/shuku/----3day--.html" btn="search_category">三日内</a></li>
|
||||
<li><a href="/pc/shuku/----7day--.html" btn="search_category">七日内</a></li>
|
||||
<li><a href="/pc/shuku/----halfmoon--.html" btn="search_category">半月内</a></li>
|
||||
<li><a href="/pc/shuku/----moon--.html" btn="search_category">一月内</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="optCl">
|
||||
<span class="optTit">排序方式</span>
|
||||
<ul class="no_bor">
|
||||
<li><a class="on" href="/pc/shuku.html">默认</a></li>
|
||||
<li><a href="/pc/shuku/-----click-.html">热度</a></li>
|
||||
<li><a href="/pc/shuku/-----updatetime-.html">更新时间</a></li>
|
||||
<li><a href="/pc/shuku/-----word-.html" btn="search_params" data-key="order" data-val="char">字数</a>
|
||||
</li>
|
||||
<li><a class="on" href="/pc/shuku/{$strNovelChannel}-{$strCategory}-all-1.html" btn="search_category">全部</a></li>
|
||||
<li><a href="/pc/shuku/{$strNovelChannel}-{$strCategory}-lianzai-1.html" btn="search_category">连载</a></li>
|
||||
<li><a href="/pc/shuku/{$strNovelChannel}-{$strCategory}-wanben-1.html" btn="search_category">完本</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -75,26 +40,26 @@
|
||||
<!--搜索结果 开始-->
|
||||
<div class="result" mod="search_data_list">
|
||||
<ul>
|
||||
{foreach $arrNovel as $key=>$Novel}
|
||||
{volist name="arrNovel" id="Novel" key="key"}
|
||||
{include file="Pc/Public/shuKuNovelList" /}
|
||||
{/foreach}
|
||||
{/volist}
|
||||
</ul>
|
||||
<!--页码切换 开始-->
|
||||
<div class="changepage">
|
||||
<ul class="pagination">
|
||||
<li class="disabled"><span>«</span></li>
|
||||
<li class="active"><span>1</span></li>
|
||||
<li><a href="/pc/shuku/------2.html">2</a></li>
|
||||
<li><a href="/pc/shuku/------3.html">3</a></li>
|
||||
<li><a href="/pc/shuku/------4.html">4</a></li>
|
||||
<li><a href="/pc/shuku/------5.html">5</a></li>
|
||||
<li><a href="/pc/shuku/------6.html">6</a></li>
|
||||
<li><a href="/pc/shuku/------7.html">7</a></li>
|
||||
<li><a href="/pc/shuku/------8.html">8</a></li>
|
||||
<li><a href="/pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-2">2</a></li>
|
||||
<li><a href="/pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-3">3</a></li>
|
||||
<li><a href="/pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-4">4</a></li>
|
||||
<li><a href="/pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-5">5</a></li>
|
||||
<li><a href="/pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-6">6</a></li>
|
||||
<li><a href="/pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-7">7</a></li>
|
||||
<li><a href="/pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-8">8</a></li>
|
||||
<li class="disabled"><span>...</span></li>
|
||||
<li><a href="/pc/shuku/------33.html">33</a></li>
|
||||
<li><a href="/pc/shuku/------34.html">34</a></li>
|
||||
<li><a href="/pc/shuku/------2.html">»</a></li>
|
||||
<li><a href="/pc//pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-33">33</a></li>
|
||||
<li><a href="/pc//pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-34">34</a></li>
|
||||
<li><a href="/pc//pc/{$strNovelChannel}-{$strCategory}-{$strStatus}-2">»</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--页码切换 结束-->
|
||||
|
||||
@@ -3,7 +3,13 @@
|
||||
{block name="title"}{/block}
|
||||
|
||||
{block name="head-css"}
|
||||
<link rel="canonical" href="www.example.com/nansheng-xiaoshuo">
|
||||
|
||||
{eq name="strPageCode" value="boys"}
|
||||
<link rel="canonical" href="{Request->DomainModel->d_domain}/nansheng-xiaoshuo">
|
||||
{else}
|
||||
<link rel="canonical" href="{Request->DomainModel->d_domain}/nvsheng-xiaoshuo">
|
||||
{/eq}
|
||||
|
||||
{/block}
|
||||
{block name="head-js"}{/block}
|
||||
|
||||
@@ -20,16 +26,17 @@
|
||||
<span class="log_line"></span>
|
||||
</div>
|
||||
<ul class="f2_list" mod="hot_tj">
|
||||
{foreach $arrRecommendSerializationNovel as $key=>$Novel}
|
||||
{volist name="arrRecommendSerializationNovel" id="Novel" key="key"}
|
||||
{include file="Pc/Public/endNovelList" /}
|
||||
{/foreach}
|
||||
{/volist}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="adv">
|
||||
{foreach $arrAdBanner as $key=>$Novel}
|
||||
{volist name="arrAdBanner" id="Ad" key="key"}
|
||||
{include file="Pc/Public/adBanner" /}
|
||||
{/foreach}
|
||||
{/volist}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -40,16 +47,16 @@
|
||||
<h2>完本推荐</h2>
|
||||
</div>
|
||||
<ul class="rec_R">
|
||||
{foreach $arrRecommendEndNovel as $key=>$Novel}
|
||||
{volist name="arrRecommendEndNovel" id="Novel" key="key"}
|
||||
{include file="Pc/Public/endNovelList" /}
|
||||
{/foreach}
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="adv">
|
||||
{foreach $arrAdBanner as $key=>$Novel}
|
||||
{volist name="arrAdBanner" id="Ad" key="key"}
|
||||
{include file="Pc/Public/adBanner" /}
|
||||
{/foreach}
|
||||
{/volist}
|
||||
</div>
|
||||
|
||||
<div class="f4 area">
|
||||
@@ -70,11 +77,9 @@
|
||||
<li class="sj">更新时间</li>
|
||||
</ul>
|
||||
</li>
|
||||
{foreach $arrNewsUpdateNovel as $key=>$Novel}
|
||||
{if $key >= 1}
|
||||
{volist name="arrNewsUpdateNovel" id="Novel" key="key"}
|
||||
{include file="Pc/Public/indexNewsUpdateList" /}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/volist}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -65,13 +65,13 @@
|
||||
<a href="/nvsheng-xiaoshuo">
|
||||
<span>女生</span>
|
||||
</a>
|
||||
<a href="/shuku.html">
|
||||
<a href="/shuku">
|
||||
<span>书库</span>
|
||||
</a>
|
||||
<a href="/rank.html">
|
||||
<a href="/paihang">
|
||||
<span>排行</span>
|
||||
</a>
|
||||
<a href="/article/list.html">
|
||||
<a href="/article/list">
|
||||
<span>文章</span>
|
||||
</a>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</h1>
|
||||
<ul class="nav">
|
||||
<li class=' {eq name="strPageCode" value="home"}on {/eq}'>
|
||||
<a href="/pc/index.html" target="_self" title="首页">首页</a>
|
||||
<a href="/pc/" target="_self" title="首页">首页</a>
|
||||
</li>
|
||||
<li class=' {eq name="strPageCode" value="boys"}on {/eq}'>
|
||||
<a href="/pc/nansheng-xiaoshuo" target="_self" title="男生">男生</a>
|
||||
@@ -33,13 +33,13 @@
|
||||
<a href="/pc/nvsheng-xiaoshuo" target="_self" title="女生">女生</a>
|
||||
</li>
|
||||
<li class=' {eq name="strPageCode" value="library"}on {/eq}'>
|
||||
<a href="/pc/shuku.html" target="_self" title="书库">书库</a>
|
||||
<a href="/pc/shuku/all" target="_self" title="书库">书库</a>
|
||||
</li>
|
||||
<li class=' {eq name="strPageCode" value="rank"}on {/eq}'>
|
||||
<a href="/pc/rank.html" target="_self" title="排行">排行</a>
|
||||
<a href="/pc/paihang" target="_self" title="排行">排行</a>
|
||||
</li>
|
||||
<li class=' {eq name="strPageCode" value="article"}on {/eq}'>
|
||||
<a href="/pc/article/list.html" target="_self" title="文章">文章</a>
|
||||
<a href="/pc/article/list" target="_self" title="文章">文章</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="headWrap_r">
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
# 狂雨小说模板
|
||||
源地址: test.nove66.net , cms 模板部署在虚拟机
|
||||
|
||||
# 是否带.html 后缀
|
||||
根据ai 分析,不带 html 版本更具好, 第一版本不带 html
|
||||
|
||||
# pc 和 h5端是否需要2个url?
|
||||
根据ai 分析,2个url 使用js 区分跳转 ,不是最优方案,h5和pc 使用一个url 才是最优方案
|
||||
|
||||
# 数据渲染
|
||||
PC
|
||||
公共数据
|
||||
@@ -32,8 +38,13 @@ pc-首页
|
||||
|
||||
|
||||
|
||||
|
||||
# 第二版本
|
||||
1.增加广广告配置,
|
||||
2.用户访问第一视图区域 展示数据以吸引用户留存为主要
|
||||
3.html 标签优化
|
||||
3.html 标签优化
|
||||
4.干扰码:
|
||||
4.1方案1: 每个a标签前面 生成一个 干扰码
|
||||
4.2方案2:
|
||||
<body> 后面 随机15-30个标签
|
||||
</body> 前面面 随机15-30个标签
|
||||
body 中间 选择 5-10行 ,a 标签前面 生成一个干扰码
|
||||
9
code/app/home/view/kuangyu/推广SEO过程设计记录/书库页面设计.md
Normal file
9
code/app/home/view/kuangyu/推广SEO过程设计记录/书库页面设计.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# 书库页面设计
|
||||
``
|
||||
推荐URL:/pc/shuku/nansheng/dushixiuxian/lianzai/1
|
||||
全部URL:/pc/shuku/all/all/all/1
|
||||
理由:
|
||||
all 提供语义支持,SEO友好。
|
||||
拼音关键词(如 nansheng、lianzai)直接优化中文搜索。
|
||||
多参数结构支持组合筛选,权重集中。
|
||||
``
|
||||
@@ -53,6 +53,82 @@ class NovelModel extends MongoModel
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param string $strKey
|
||||
* @param int $intLifeTime
|
||||
* @param integer $intCount
|
||||
* @param integer $intType
|
||||
* @param string $strStatus
|
||||
* @param array $arrSort
|
||||
* @return array
|
||||
*/
|
||||
public function getCommonNovelOnCache(
|
||||
string $strKey,
|
||||
int $intLifeTime = 24 * 3600,
|
||||
int $intCount = 10,
|
||||
int $intType = 0,
|
||||
$strStatus = NULL,
|
||||
array $arrSort = ['n_level' => -1]
|
||||
): array {
|
||||
try {
|
||||
|
||||
$arrResult = Cache::get($strKey);
|
||||
|
||||
// if (empty($arrResult)) {
|
||||
if (true) {
|
||||
$arrFilter = [];
|
||||
|
||||
switch ($intType) {
|
||||
case 1:
|
||||
$arrCategory = array_values(CategoryModel::getManCategory());
|
||||
$arrFilter['og_novel_category'] = ['$in' => $arrCategory];
|
||||
break;
|
||||
case 2:
|
||||
$arrCategory = array_values(CategoryModel::getWomenCategory());
|
||||
$arrFilter['og_novel_category'] = ['$in' => $arrCategory];
|
||||
break;
|
||||
}
|
||||
|
||||
if ($strStatus !== NULL) {
|
||||
$arrFilter['og_novel_status'] = $strStatus;
|
||||
}
|
||||
|
||||
$arrOptions = [
|
||||
'sort' => $arrSort,
|
||||
'limit' => $intCount * 3,
|
||||
'projection' => [
|
||||
'n_id' => 1,
|
||||
'og_novel_book_name' => 1,
|
||||
'og_novel_pin_yin' => 1,
|
||||
'n_cover_path' => 1,
|
||||
'og_novel_author' => 1,
|
||||
'og_novel_category' => 1,
|
||||
'og_description' => 1,
|
||||
'og_novel_latest_chapter_name' => 1,
|
||||
'og_novel_update_time' => 1,
|
||||
],
|
||||
];
|
||||
|
||||
$Cursor = $this->getCol()->find($arrFilter, $arrOptions);
|
||||
$arrResult = iterator_to_array($Cursor);
|
||||
|
||||
shuffle($arrResult);
|
||||
|
||||
$arrResult = array_slice($arrResult, 0, $intCount);
|
||||
|
||||
if (!empty($arrResult)) {
|
||||
Cache::set($strKey, $arrResult, $intLifeTime);
|
||||
}
|
||||
}
|
||||
|
||||
return $arrResult;
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
@@ -63,7 +139,7 @@ class NovelModel extends MongoModel
|
||||
* @param integer $intLevel
|
||||
* @return array
|
||||
*/
|
||||
public function getHighLevelNovelOnCache(string $strSign, int $intCount = 10, int $intType = 0): array
|
||||
public function getHighLevelNovelOnCache(string $strSign, int $intCount = 10, int $intType = 0, $strStatus = NULL): array
|
||||
{
|
||||
try {
|
||||
$strKey = sprintf('%s:PC:HOME:FIRST', $strSign);
|
||||
@@ -74,18 +150,21 @@ class NovelModel extends MongoModel
|
||||
|
||||
// if (empty($arrResult)) {
|
||||
if (true) {
|
||||
if ($intType == 1) {
|
||||
$arrCategory = array_values(CategoryModel::getManCategory());
|
||||
$arrFilter = [
|
||||
'og_novel_category' => ['$in' => $arrCategory]
|
||||
];
|
||||
} elseif ($intType == 2) {
|
||||
$arrCategory = array_values(CategoryModel::getWomenCategory());
|
||||
$arrFilter = [
|
||||
'og_novel_category' => ['$in' => $arrCategory]
|
||||
];
|
||||
} else {
|
||||
$arrFilter = [];
|
||||
$arrFilter = [];
|
||||
|
||||
switch ($intType) {
|
||||
case 1:
|
||||
$arrCategory = array_values(CategoryModel::getManCategory());
|
||||
$arrFilter['og_novel_category'] = ['$in' => $arrCategory];
|
||||
break;
|
||||
case 2:
|
||||
$arrCategory = array_values(CategoryModel::getWomenCategory());
|
||||
$arrFilter['og_novel_category'] = ['$in' => $arrCategory];
|
||||
break;
|
||||
}
|
||||
|
||||
if ($strStatus !== NULL) {
|
||||
$arrFilter['og_novel_status'] = $strStatus;
|
||||
}
|
||||
|
||||
$arrOptions = [
|
||||
|
||||
@@ -159,7 +159,7 @@ class NovelPage extends BasePage
|
||||
}
|
||||
|
||||
if (!isset($this->arrNovelInfo['n_cover_path']) || empty($this->arrNovelInfo['n_cover_path'])) {
|
||||
$this->arrNovelInfo['n_cover_path'] = 'img/' . date('Y/m/d', time() - 24 * 3600 * 14) . '/' . $this->arrNovelInfo['n_id'] . '.jpg';
|
||||
$this->arrNovelInfo['n_cover_path'] = '/img/' . date('Y/m/d', time() - 24 * 3600 * 14) . '/' . $this->arrNovelInfo['n_id'] . '.jpg';
|
||||
}
|
||||
|
||||
$this->arrNovelInfo['updated_at'] = new \MongoDB\BSON\UTCDateTime();
|
||||
|
||||
Reference in New Issue
Block a user