修复bug

This commit is contained in:
2016-08-31 09:24:56 +08:00
parent dff622f0ac
commit a12aba3512
2 changed files with 9 additions and 7 deletions

View File

@@ -269,6 +269,7 @@ class Content extends Admin {
if ($this->modelInfo['extend'] == 1) {
$category = isset($data['category']) ? $data['category'] : '';
$cate_list = parse_field_bind('category', $category, 0);
$map['model_id'] = $this->model_id;
$this->assign('cate_list', $cate_list);
}
$this->assign($data);

View File

@@ -59,19 +59,20 @@ class Content extends Fornt {
$cate = $this->getCategory($id);
//获得当前栏目的所有子栏目
$ids = get_category_child($id);
$map['category_id'] = array('IN', $ids);
$map['model_id'] = $this->modelInfo['id'];
$map['status'] = array('GT', 0);
if ($this->modelInfo['extend'] == 1) {
//获得当前栏目的所有子栏目
$ids = get_category_child($id);
$map['category_id'] = array('IN', $ids);
$map['model_id'] = $this->modelInfo['id'];
$map['status'] = array('GT', 0);
}
if ($this->modelInfo['extend'] > 1) {
$order = "id desc";
} else {
$order = "is_top desc,id desc";
}
$model = $this->model;
$list = $model->where($map)->order($order)->paginate(15);
$list = $this->model->where($map)->order($order)->paginate(15);
$data = array(
'list' => $list,