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

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

@@ -99,7 +99,7 @@ class IndexController extends HomeBaseController @@ -99,7 +99,7 @@ class IndexController extends HomeBaseController
99 $position = CityCategoryModel::xqyy; 99 $position = CityCategoryModel::xqyy;
100 $city_id = CityCategoryModel::djxq; 100 $city_id = CityCategoryModel::djxq;
101 $field = 'id,more,thumbnail'; 101 $field = 'id,more,thumbnail';
102 - $res_djxq = $this->getVideo($position,$city_id,$field,1); 102 + $res_djxq = $this->getVideo($position,$city_id,$field,1,1);
103 foreach($res_djxq as &$value){ 103 foreach($res_djxq as &$value){
104 $video = json_decode($value['more'],true); 104 $video = json_decode($value['more'],true);
105 $value['video'] = $video['video']; 105 $value['video'] = $video['video'];
@@ -234,7 +234,7 @@ class IndexController extends HomeBaseController @@ -234,7 +234,7 @@ class IndexController extends HomeBaseController
234 } 234 }
235 235
236 //获取推荐视频 236 //获取推荐视频
237 - public function getVideo($position,$city_id,$field,$limit=''){ 237 + public function getVideo($position,$city_id,$field,$limit='',$extension=''){
238 $pre = CityCategoryModel::pre; 238 $pre = CityCategoryModel::pre;
239 $limit = empty($limit)?0:$limit; 239 $limit = empty($limit)?0:$limit;
240 $post_id = Db::table($pre.'portal_category_post') 240 $post_id = Db::table($pre.'portal_category_post')
@@ -244,9 +244,14 @@ class IndexController extends HomeBaseController @@ -244,9 +244,14 @@ class IndexController extends HomeBaseController
244 ->toArray(); 244 ->toArray();
245 $post_id = array_column($post_id,'post_id'); 245 $post_id = array_column($post_id,'post_id');
246 //查询文章 246 //查询文章
  247 + if(!empty($extension)){
  248 + $where = ['city_id'=>$city_id,'is_show'=>1];
  249 + }else{
  250 + $where = ['city_id'=>$city_id];
  251 + }
247 $res = Db::table($pre.'portal_post') 252 $res = Db::table($pre.'portal_post')
248 ->whereIn('id',$post_id) 253 ->whereIn('id',$post_id)
249 - ->where('city_id', $city_id) 254 + ->where($where)
250 ->where('delete_time', 0) 255 ->where('delete_time', 0)
251 ->field($field) 256 ->field($field)
252 ->limit($limit) 257 ->limit($limit)
@@ -134,7 +134,7 @@ class StarController extends HomeBaseController @@ -134,7 +134,7 @@ class StarController extends HomeBaseController
134 $pre = CityCategoryModel::pre; 134 $pre = CityCategoryModel::pre;
135 $limit = empty($limit)?$this->more_limit:$limit; 135 $limit = empty($limit)?$this->more_limit:$limit;
136 if($limit == -1){ 136 if($limit == -1){
137 - $limit = 0; 137 + $limit = 1500;
138 } 138 }
139 $post_id = Db::table($pre.'portal_category_post') 139 $post_id = Db::table($pre.'portal_category_post')
140 ->whereIn('category_id',$position['category_id']) 140 ->whereIn('category_id',$position['category_id'])