作者 景龙
1 个管道 的构建 通过 耗费 0 秒

修改独角星球首页弹窗和更多视频列表限制

... ... @@ -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)
... ...
... ... @@ -134,7 +134,7 @@ class StarController extends HomeBaseController
$pre = CityCategoryModel::pre;
$limit = empty($limit)?$this->more_limit:$limit;
if($limit == -1){
$limit = 0;
$limit = 1500;
}
$post_id = Db::table($pre.'portal_category_post')
->whereIn('category_id',$position['category_id'])
... ...