...
|
...
|
@@ -17,20 +17,19 @@ use think\Db; |
|
|
class ActiveController extends HomeBaseController
|
|
|
{
|
|
|
private $index_limit = 16;//首页分页
|
|
|
private $more_limit = 6;//更多列表分页
|
|
|
private $more_limit = 5;//更多列表分页
|
|
|
public function index(){
|
|
|
//星际活动
|
|
|
$page = $this->request->param('page',1,'intval');
|
|
|
$position['category_id'] = CityCategoryModel::xjhd_c;
|
|
|
$field = 'id,thumbnail,post_title';
|
|
|
$res_xjhd = $this->getChildArticlePage($position,$field,$page);
|
|
|
$this->assign('res_xjhd',$res_xjhd);
|
|
|
|
|
|
$res = $this->getChildArticlePage($position,$field);
|
|
|
$this->assign('res',$res['data']);
|
|
|
$this->assign('page',$res['page']);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
|
//根据子类获取文章分页
|
|
|
public function getChildArticlePage($position,$field,$page,$limit=''){
|
|
|
public function getChildArticlePage($position,$field,$limit=''){
|
|
|
$pre = CityCategoryModel::pre;
|
|
|
$limit = empty($limit)?$this->more_limit:$limit;
|
|
|
$post_id = Db::table($pre.'portal_category_post')
|
...
|
...
|
@@ -44,10 +43,10 @@ class ActiveController extends HomeBaseController |
|
|
->whereIn('id',$post_id)
|
|
|
->where('delete_time', 0)
|
|
|
->field($field)
|
|
|
->page($page,$limit)
|
|
|
->order('weigh desc')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
->paginate($limit);
|
|
|
$arr['data'] = $res->toArray();
|
|
|
$arr['page'] = $res->render();
|
|
|
return $res;
|
|
|
}
|
|
|
|
...
|
...
|
|