修复bug
This commit is contained in:
@@ -269,6 +269,7 @@ class Content extends Admin {
|
|||||||
if ($this->modelInfo['extend'] == 1) {
|
if ($this->modelInfo['extend'] == 1) {
|
||||||
$category = isset($data['category']) ? $data['category'] : '';
|
$category = isset($data['category']) ? $data['category'] : '';
|
||||||
$cate_list = parse_field_bind('category', $category, 0);
|
$cate_list = parse_field_bind('category', $category, 0);
|
||||||
|
$map['model_id'] = $this->model_id;
|
||||||
$this->assign('cate_list', $cate_list);
|
$this->assign('cate_list', $cate_list);
|
||||||
}
|
}
|
||||||
$this->assign($data);
|
$this->assign($data);
|
||||||
|
|||||||
@@ -59,19 +59,20 @@ class Content extends Fornt {
|
|||||||
|
|
||||||
$cate = $this->getCategory($id);
|
$cate = $this->getCategory($id);
|
||||||
|
|
||||||
//获得当前栏目的所有子栏目
|
if ($this->modelInfo['extend'] == 1) {
|
||||||
$ids = get_category_child($id);
|
//获得当前栏目的所有子栏目
|
||||||
$map['category_id'] = array('IN', $ids);
|
$ids = get_category_child($id);
|
||||||
$map['model_id'] = $this->modelInfo['id'];
|
$map['category_id'] = array('IN', $ids);
|
||||||
$map['status'] = array('GT', 0);
|
$map['model_id'] = $this->modelInfo['id'];
|
||||||
|
$map['status'] = array('GT', 0);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->modelInfo['extend'] > 1) {
|
if ($this->modelInfo['extend'] > 1) {
|
||||||
$order = "id desc";
|
$order = "id desc";
|
||||||
} else {
|
} else {
|
||||||
$order = "is_top desc,id desc";
|
$order = "is_top desc,id desc";
|
||||||
}
|
}
|
||||||
$model = $this->model;
|
$list = $this->model->where($map)->order($order)->paginate(15);
|
||||||
$list = $model->where($map)->order($order)->paginate(15);
|
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'list' => $list,
|
'list' => $list,
|
||||||
|
|||||||
Reference in New Issue
Block a user