...
|
...
|
@@ -99,7 +99,7 @@ class IndexController extends HomeBaseController |
|
|
$position = CityCategoryModel::xqyy;
|
|
|
$city_id = CityCategoryModel::djxq;
|
|
|
$field = 'id,more,thumbnail';
|
|
|
$res_djxq = $this->getVideo($position,$city_id,$field,1);
|
|
|
$res_djxq = $this->getVideo($position,$city_id,$field,1,1);
|
|
|
foreach($res_djxq as &$value){
|
|
|
$video = json_decode($value['more'],true);
|
|
|
$value['video'] = $video['video'];
|
...
|
...
|
@@ -234,7 +234,7 @@ class IndexController extends HomeBaseController |
|
|
}
|
|
|
|
|
|
//获取推荐视频
|
|
|
public function getVideo($position,$city_id,$field,$limit=''){
|
|
|
public function getVideo($position,$city_id,$field,$limit='',$extension=''){
|
|
|
$pre = CityCategoryModel::pre;
|
|
|
$limit = empty($limit)?0:$limit;
|
|
|
$post_id = Db::table($pre.'portal_category_post')
|
...
|
...
|
@@ -244,9 +244,14 @@ class IndexController extends HomeBaseController |
|
|
->toArray();
|
|
|
$post_id = array_column($post_id,'post_id');
|
|
|
//查询文章
|
|
|
if(!empty($extension)){
|
|
|
$where = ['city_id'=>$city_id,'is_show'=>1];
|
|
|
}else{
|
|
|
$where = ['city_id'=>$city_id];
|
|
|
}
|
|
|
$res = Db::table($pre.'portal_post')
|
|
|
->whereIn('id',$post_id)
|
|
|
->where('city_id', $city_id)
|
|
|
->where($where)
|
|
|
->where('delete_time', 0)
|
|
|
->field($field)
|
|
|
->limit($limit)
|
...
|
...
|
|