...
|
...
|
@@ -21,12 +21,17 @@ class IndexController extends HomeBaseController |
|
|
$serverModel = new ServerController();
|
|
|
//统计访问量
|
|
|
$serverModel->statistics();
|
|
|
|
|
|
//banner轮播图
|
|
|
$coverImg = cache('coverImg');
|
|
|
if(!$coverImg){
|
|
|
$coverImg = $this->getCoverImg(CityCategoryModel::indexImg,3);
|
|
|
cache('coverImg',$coverImg,86400);
|
|
|
}
|
|
|
$this->assign('coverImg',$coverImg);
|
|
|
|
|
|
//星球奇境,城市分类
|
|
|
$city = cache('res_city');
|
|
|
if(!$city){
|
|
|
$city[1]['id'] = CityCategoryModel::asia;
|
|
|
$city[2]['id'] = CityCategoryModel::europe;
|
|
|
$city[3]['id'] = CityCategoryModel::africa;
|
...
|
...
|
@@ -47,9 +52,13 @@ class IndexController extends HomeBaseController |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
cache('res_city', $city,86400);//有效期一天
|
|
|
}
|
|
|
$this->assign('res_city',$city);
|
|
|
|
|
|
//星享体验
|
|
|
$month = cache('res_month');
|
|
|
if(!$month){
|
|
|
$res_month = $this->getMonthArticle();
|
|
|
$month = [];
|
|
|
foreach($res_month['data'] as &$value){
|
...
|
...
|
@@ -63,9 +72,13 @@ class IndexController extends HomeBaseController |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
cache('res_month', $month,86400);//有效期一天
|
|
|
}
|
|
|
$this->assign('res_month',$month);
|
|
|
|
|
|
//星域秀场->星球影院
|
|
|
$res_xqyy = cache('res_xqyy');
|
|
|
if(!$res_xqyy){
|
|
|
$position = CityCategoryModel::xqyy;
|
|
|
$field = 'id,more,thumbnail';
|
|
|
$res_xqyy = $this->getChildArticle($position,$field,1);
|
...
|
...
|
@@ -76,6 +89,8 @@ class IndexController extends HomeBaseController |
|
|
if($res_xqyy){
|
|
|
$res_xqyy = $res_xqyy[0];
|
|
|
}
|
|
|
cache('res_xqyy', $res_xqyy,86400);//有效期一天
|
|
|
}
|
|
|
$this->assign('res_xqyy',$res_xqyy);
|
|
|
|
|
|
//推广视频
|
...
|
...
|
@@ -93,33 +108,49 @@ class IndexController extends HomeBaseController |
|
|
$this->assign('res_djxq',$res_djxq);
|
|
|
|
|
|
//星域秀场->明星访谈
|
|
|
$res_mxft = cache('res_mxft');
|
|
|
if(!$res_mxft){
|
|
|
$position = CityCategoryModel::mxft;
|
|
|
$field = 'id,full_name,position,trade,post_excerpt,thumbnail avatar';
|
|
|
$res_mxft = $this->getChildArticle($position,$field,1);
|
|
|
if($res_mxft){
|
|
|
$res_mxft = $res_mxft[0];
|
|
|
}
|
|
|
cache('res_mxft',$res_mxft,86400);
|
|
|
}
|
|
|
$this->assign('res_mxft',$res_mxft);
|
|
|
|
|
|
|
|
|
//星域秀场->星域画廊
|
|
|
$res_xyhl = cache('res_xyhl');
|
|
|
if(!$res_xyhl){
|
|
|
$position = CityCategoryModel::xyhl;
|
|
|
$field = 'id,thumbnail';
|
|
|
$res_xyhl = $this->getChildArticle($position,$field,16);
|
|
|
cache('res_xyhl',$res_xyhl,86400);
|
|
|
}
|
|
|
$this->assign('res_xyhl',$res_xyhl);
|
|
|
|
|
|
|
|
|
//星探推荐
|
|
|
$res_xttj = cache('res_xttj');
|
|
|
if(!$res_xttj){
|
|
|
$position = CityCategoryModel::xttj;
|
|
|
$field = 'id,post_title,price,index_thumbnail,place';
|
|
|
$res_xttj = $this->getParentArticle($position,$field,16);
|
|
|
cache('res_xttj',$res_xttj,86400);
|
|
|
}
|
|
|
$this->assign('res_xttj',$res_xttj);
|
|
|
|
|
|
|
|
|
//星际活动
|
|
|
$res_xjhd = cache('res_xjhd');
|
|
|
if(!$res_xjhd){
|
|
|
$position = CityCategoryModel::xjhd;
|
|
|
$field = 'id,post_title,thumbnail';
|
|
|
$res_xjhd = $this->getParentArticle($position,$field,2);
|
|
|
cache('res_xjhd',$res_xjhd,86400);
|
|
|
}
|
|
|
$this->assign('res_xjhd',$res_xjhd);
|
|
|
return $this->fetch();
|
|
|
}
|
...
|
...
|
|