...
|
...
|
@@ -77,19 +77,29 @@ class IndexController extends HomeBaseController |
|
|
$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);
|
|
|
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);//有效期一天
|
|
|
// $res_xqyy = cache('res_xqyy');
|
|
|
// if(!$res_xqyy){
|
|
|
// $position = CityCategoryModel::xqyy;
|
|
|
// $field = 'id,more,thumbnail';
|
|
|
// $res_xqyy = $this->getVideoIndex($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);//有效期一天
|
|
|
// }
|
|
|
$position = CityCategoryModel::xqyy;
|
|
|
$field = 'id,more,thumbnail';
|
|
|
$res_xqyy = $this->getVideoIndex($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];
|
|
|
}
|
|
|
$this->assign('res_xqyy',$res_xqyy);
|
|
|
|
...
|
...
|
@@ -206,6 +216,28 @@ class IndexController extends HomeBaseController |
|
|
return $res;
|
|
|
}
|
|
|
|
|
|
//获取显示首页视频
|
|
|
public function getVideoIndex($position,$field,$limit=''){
|
|
|
$pre = CityCategoryModel::pre;
|
|
|
$limit = empty($limit)?0:$limit;
|
|
|
$post_id = Db::table($pre.'portal_category_post')
|
|
|
->whereIn('category_id',$position)
|
|
|
->field('post_id')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
$post_id = array_column($post_id,'post_id');
|
|
|
//查询文章
|
|
|
$res = Db::table($pre.'portal_post')
|
|
|
->whereIn('id',$post_id)
|
|
|
->where(['delete_time'=>0,'is_show'=>1])
|
|
|
->field($field)
|
|
|
->limit($limit)
|
|
|
->order('weigh desc')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
return $res;
|
|
|
}
|
|
|
|
|
|
//获取推荐视频
|
|
|
public function getVideo($position,$city_id,$field,$limit=''){
|
|
|
$pre = CityCategoryModel::pre;
|
...
|
...
|
|