article jie show
This commit is contained in:
parent
2641921efb
commit
d5ce1b5cbf
@ -40,7 +40,7 @@ class Article extends BaseController
|
||||
switch ($type) {
|
||||
//查询文章,15个分1页
|
||||
case 'jie':
|
||||
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot')->with([
|
||||
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
@ -51,7 +51,7 @@ class Article extends BaseController
|
||||
break;
|
||||
|
||||
case 'hot':
|
||||
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot')->with([
|
||||
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
@ -62,7 +62,7 @@ class Article extends BaseController
|
||||
break;
|
||||
|
||||
case 'top':
|
||||
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot')->with([
|
||||
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
@ -73,7 +73,7 @@ class Article extends BaseController
|
||||
break;
|
||||
|
||||
default:
|
||||
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot')->with([
|
||||
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
|
@ -26,7 +26,7 @@ class Index extends BaseController
|
||||
//置顶文章
|
||||
$artTop = Cache::get('arttop');
|
||||
if(!$artTop){
|
||||
$artTop = Article::field('id,title,title_color,cate_id,user_id,create_time,is_top')->where(['is_top'=>1,'status'=>1,'delete_time'=>0])->with([
|
||||
$artTop = Article::field('id,title,title_color,cate_id,user_id,create_time,is_top,jie')->where(['is_top'=>1,'status'=>1,'delete_time'=>0])->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
@ -40,7 +40,7 @@ class Index extends BaseController
|
||||
//首页文章显示20条
|
||||
$artList = Cache::get('artlist');
|
||||
if(!$artList){
|
||||
$artList = Article::field('id,title,title_color,cate_id,user_id,create_time,is_hot')->with([
|
||||
$artList = Article::field('id,title,title_color,cate_id,user_id,create_time,is_hot,jie')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user