...
|
...
|
@@ -21,60 +21,75 @@ class IndexController extends HomeBaseController |
|
|
$serverModel = new ServerController();
|
|
|
//统计访问量
|
|
|
$serverModel->statistics();
|
|
|
|
|
|
//banner轮播图
|
|
|
$coverImg = $this->getCoverImg(CityCategoryModel::indexImg,3);
|
|
|
$coverImg = cache('coverImg');
|
|
|
if(!$coverImg){
|
|
|
$coverImg = $this->getCoverImg(CityCategoryModel::indexImg,3);
|
|
|
cache('coverImg',$coverImg,86400);
|
|
|
}
|
|
|
$this->assign('coverImg',$coverImg);
|
|
|
|
|
|
//星球奇境,城市分类
|
|
|
$city[1]['id'] = CityCategoryModel::asia;
|
|
|
$city[2]['id'] = CityCategoryModel::europe;
|
|
|
$city[3]['id'] = CityCategoryModel::africa;
|
|
|
$city[4]['id'] = CityCategoryModel::oceania;
|
|
|
$city[5]['id'] = CityCategoryModel::north;
|
|
|
$city[6]['id'] = CityCategoryModel::south;
|
|
|
$city[20]['id'] = CityCategoryModel::antarctica;
|
|
|
$city[43]['id'] = CityCategoryModel::arctic;
|
|
|
$city_name = $this->getCity(array_column($city,'id'));
|
|
|
foreach($city as &$value){
|
|
|
$k = 0;
|
|
|
foreach($city_name as $value1){
|
|
|
$k += 0;
|
|
|
if($value['id'] == $value1['pid']){
|
|
|
$value['name'][$k]['name'] = $value1['name'];
|
|
|
$value['name'][$k]['id'] = $value1['id'];
|
|
|
$k++;
|
|
|
$city = cache('res_city');
|
|
|
if(!$city){
|
|
|
$city[1]['id'] = CityCategoryModel::asia;
|
|
|
$city[2]['id'] = CityCategoryModel::europe;
|
|
|
$city[3]['id'] = CityCategoryModel::africa;
|
|
|
$city[4]['id'] = CityCategoryModel::oceania;
|
|
|
$city[5]['id'] = CityCategoryModel::north;
|
|
|
$city[6]['id'] = CityCategoryModel::south;
|
|
|
$city[20]['id'] = CityCategoryModel::antarctica;
|
|
|
$city[43]['id'] = CityCategoryModel::arctic;
|
|
|
$city_name = $this->getCity(array_column($city,'id'));
|
|
|
foreach($city as &$value){
|
|
|
$k = 0;
|
|
|
foreach($city_name as $value1){
|
|
|
$k += 0;
|
|
|
if($value['id'] == $value1['pid']){
|
|
|
$value['name'][$k]['name'] = $value1['name'];
|
|
|
$value['name'][$k]['id'] = $value1['id'];
|
|
|
$k++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
cache('res_city', $city,86400);//有效期一天
|
|
|
}
|
|
|
$this->assign('res_city',$city);
|
|
|
|
|
|
//星享体验
|
|
|
$res_month = $this->getMonthArticle();
|
|
|
$month = [];
|
|
|
foreach($res_month['data'] as &$value){
|
|
|
$month[$value['month']]['id'] = $value['id'];
|
|
|
$month[$value['month']]['month'] = $value['month'];
|
|
|
$month[$value['month']]['post_title'] = $value['post_title'];
|
|
|
$month[$value['month']]['index_thumbnail'] = $value['index_thumbnail'];
|
|
|
foreach($res_month['category_name'] as $value1){
|
|
|
if($value['id'] == $value1['post_id']){
|
|
|
$month[$value['month']]['category_name'] = $value1['name'];
|
|
|
$month = cache('res_month');
|
|
|
if(!$month){
|
|
|
$res_month = $this->getMonthArticle();
|
|
|
$month = [];
|
|
|
foreach($res_month['data'] as &$value){
|
|
|
$month[$value['month']]['id'] = $value['id'];
|
|
|
$month[$value['month']]['month'] = $value['month'];
|
|
|
$month[$value['month']]['post_title'] = $value['post_title'];
|
|
|
$month[$value['month']]['index_thumbnail'] = $value['index_thumbnail'];
|
|
|
foreach($res_month['category_name'] as $value1){
|
|
|
if($value['id'] == $value1['post_id']){
|
|
|
$month[$value['month']]['category_name'] = $value1['name'];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
cache('res_month', $month,86400);//有效期一天
|
|
|
}
|
|
|
$this->assign('res_month',$month);
|
|
|
|
|
|
//星域秀场->星球影院
|
|
|
$position = CityCategoryModel::xqyy;
|
|
|
$field = 'id,more,thumbnail';
|
|
|
$res_xqyy = $this->getChildArticle($position,$field,1);
|
|
|
foreach($res_xqyy as &$value){
|
|
|
$video = json_decode($value['more'],true);
|
|
|
$value['video'] = $video['video'];
|
|
|
}
|
|
|
if($res_xqyy){
|
|
|
$res_xqyy = $res_xqyy[0];
|
|
|
$res_xqyy = cache('res_xqyy');
|
|
|
if(!$res_xqyy){
|
|
|
$position = CityCategoryModel::xqyy;
|
|
|
$field = 'id,more,thumbnail';
|
|
|
$res_xqyy = $this->getChildArticle($position,$field,1);
|
|
|
foreach($res_xqyy as &$value){
|
|
|
$video = json_decode($value['more'],true);
|
|
|
$value['video'] = $video['video'];
|
|
|
}
|
|
|
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);
|
|
|
|
|
|
//星域秀场->明星访谈
|
|
|
$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];
|
|
|
$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);
|
|
|
|
|
|
|
|
|
//星域秀场->星域画廊
|
|
|
$position = CityCategoryModel::xyhl;
|
|
|
$field = 'id,thumbnail';
|
|
|
$res_xyhl = $this->getChildArticle($position,$field,16);
|
|
|
$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);
|
|
|
|
|
|
|
|
|
//星探推荐
|
|
|
$position = CityCategoryModel::xttj;
|
|
|
$field = 'id,post_title,price,index_thumbnail,place';
|
|
|
$res_xttj = $this->getParentArticle($position,$field,16);
|
|
|
$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);
|
|
|
|
|
|
|
|
|
//星际活动
|
|
|
$position = CityCategoryModel::xjhd;
|
|
|
$field = 'id,post_title,thumbnail';
|
|
|
$res_xjhd = $this->getParentArticle($position,$field,2);
|
|
|
$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();
|
|
|
}
|
...
|
...
|
|