...
|
...
|
@@ -230,10 +230,9 @@ class LoginController extends HomeBaseController |
|
|
->join('city_category c','p.city_id = c.id','LEFT')
|
|
|
->join('portal_category_post c_p','p.id = c_p.post_id','LEFT')
|
|
|
->where('p.post_title','like','%'.$keyword.'%')
|
|
|
->where('c_p.category_id','<>',CityCategoryModel::xqyy)
|
|
|
->where('c_p.category_id','<>',CityCategoryModel::xyhl)
|
|
|
->where('p.delete_time', 0)
|
|
|
->field('p.id,p.post_title,p.post_excerpt,p.post_favorites,c.name city_name')
|
|
|
->field('p.id,p.post_title,p.post_excerpt,p.post_favorites,c.name city_name,c.id city_id')
|
|
|
->order('p.weigh desc')
|
|
|
->paginate($limit,false,['query'=>request()->param()]);
|
|
|
$data = $res->toArray();
|
...
|
...
|
@@ -253,7 +252,7 @@ class LoginController extends HomeBaseController |
|
|
foreach($category as $item){
|
|
|
if($value['id'] == $item['post_id']){
|
|
|
$value['category_name'] = $item['name'];
|
|
|
$value['post_url'] = $this->getDetailUrl($item['id']);
|
|
|
$value['post_url'] = $this->getDetailUrl($item['id'],$value['city_id']);
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -263,7 +262,6 @@ class LoginController extends HomeBaseController |
|
|
->alias('p')
|
|
|
->join('portal_category_post c_p','p.id = c_p.post_id','LEFT')
|
|
|
->where('p.post_title','like','%'.$keyword.'%')
|
|
|
->where('c_p.category_id','<>',CityCategoryModel::xqyy)
|
|
|
->where('c_p.category_id','<>',CityCategoryModel::xyhl)
|
|
|
->where('p.delete_time', 0)
|
|
|
->count();
|
...
|
...
|
@@ -279,12 +277,15 @@ class LoginController extends HomeBaseController |
|
|
}
|
|
|
|
|
|
//获取各个板块详情页位置
|
|
|
public function getDetailUrl($c_id){
|
|
|
public function getDetailUrl($c_id,$city_id){
|
|
|
$url = '';
|
|
|
switch ($c_id) {
|
|
|
case CityCategoryModel::xqgs:
|
|
|
$url = '/portal/star/getStoryDetail';
|
|
|
break;
|
|
|
case CityCategoryModel::xqyy:
|
|
|
$url = '/portal/region/getMoreVideo?city_id='.$city_id;
|
|
|
break;
|
|
|
case CityCategoryModel::whmj:
|
|
|
$url = '/portal/star/getSceneryDetail';
|
|
|
break;
|
...
|
...
|
|