...
|
...
|
@@ -65,6 +65,20 @@ class IndexController extends HomeBaseController |
|
|
}
|
|
|
$this->assign('res_xqyy',$res_xqyy);
|
|
|
|
|
|
//推广视频
|
|
|
$position = CityCategoryModel::xqyy;
|
|
|
$city_id = CityCategoryModel::djxq;
|
|
|
$field = 'id,more,thumbnail';
|
|
|
$res_djxq = $this->getVideo($position,$city_id,$field,1);
|
|
|
foreach($res_djxq as &$value){
|
|
|
$video = json_decode($value['more'],true);
|
|
|
$value['video'] = $video['video'];
|
|
|
}
|
|
|
if($res_djxq){
|
|
|
$res_djxq = $res_djxq[0];
|
|
|
}
|
|
|
$this->assign('res_djxq',$res_djxq);
|
|
|
|
|
|
//星域秀场->明星访谈
|
|
|
$position = CityCategoryModel::mxft;
|
|
|
$field = 'id,full_name,position,trade,post_excerpt,thumbnail avatar';
|
...
|
...
|
@@ -148,13 +162,38 @@ class IndexController extends HomeBaseController |
|
|
return $res;
|
|
|
}
|
|
|
|
|
|
//获取推荐视频
|
|
|
public function getVideo($position,$city_id,$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('city_id', $city_id)
|
|
|
->where('delete_time', 0)
|
|
|
->field($field)
|
|
|
->limit($limit)
|
|
|
->order('weigh desc')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
return $res;
|
|
|
}
|
|
|
|
|
|
//获取各洲对应的城市
|
|
|
private function getCity($pid){
|
|
|
$pre = CityCategoryModel::pre;
|
|
|
$res = Db::table($pre.'city_category')
|
|
|
->where('pid',$pid)
|
|
|
->where('is_show',1)
|
|
|
->where('delete_time', 0)
|
|
|
->field('id,pid,name')
|
|
|
->order('weigh desc')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
return $res;
|
...
|
...
|
|