...
|
...
|
@@ -149,7 +149,7 @@ class RegionController extends HomeBaseController |
|
|
$position['city_id'] = $city_id;
|
|
|
$position['category_id'] = CityCategoryModel::xqyy;
|
|
|
$field = 'id,post_title,framing,release_time,city_id,more,thumbnail';
|
|
|
$res = $this->getVideoArticlePage($position,$field);
|
|
|
$res = $star->getChildArticlePage($position,$field);
|
|
|
foreach($res['data']['data'] as &$value){
|
|
|
$more = json_decode($value['more'],true);
|
|
|
$value['video'] = isset($more['video']) && !empty($more['video'])?$more['video']:'';
|
...
|
...
|
@@ -166,34 +166,6 @@ class RegionController extends HomeBaseController |
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
|
//获取更多视频
|
|
|
public function getVideoArticlePage($position,$field,$limit = ''){
|
|
|
$pre = CityCategoryModel::pre;
|
|
|
$limit = empty($limit)?$this->more_limit:$limit;
|
|
|
$post_id = Db::table($pre.'portal_category_post')
|
|
|
->whereIn('category_id',$position['category_id'])
|
|
|
->field('post_id')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
$post_id = array_column($post_id,'post_id');
|
|
|
//查询文章
|
|
|
if($position['city_id'] == 0){
|
|
|
//所有
|
|
|
$where = ['delete_time'=>0,'is_show'=>0];
|
|
|
}else{
|
|
|
$where = ['city_id'=>$position['city_id'],'delete_time'=>0,'is_show'=>0];
|
|
|
}
|
|
|
$res = Db::table($pre.'portal_post')
|
|
|
->whereIn('id',$post_id)
|
|
|
->where($where)
|
|
|
->field($field)
|
|
|
->order('weigh desc')
|
|
|
->paginate($limit,false,['query'=>request()->param()]);
|
|
|
$arr['data'] = $res->toArray();
|
|
|
$arr['page'] = $res->render();
|
|
|
return $arr;
|
|
|
}
|
|
|
|
|
|
//获取城市名称
|
|
|
public function getVideoCityName(){
|
|
|
$res = Db::name('city_category')
|
...
|
...
|
|