方法一:
下载最新的博客系统进行安装
最新LzCMS(博客系统)下载地址:http://git.oschina.net/phplaozhang/LzCMS-LaoZhangBoKeXiTong
方法二:
修改文件 /application/admin/controller/Category.php
找到 function del() 函数
将次函数修改为
function del(){ $id = input('post.id'); $child_ids = $this->model->get_category_ids($id); if($child_ids){ return json(array('code'=>0,'msg'=>'请先删除该栏目的下级栏目')); } $category = cache('categorys')[$id]; if($category['model_id'] && $category['model_id'] != 1){ $count = model($category['model_code'])->where('category_id',$id)->count('id'); if($count > 0){ return json(array('code'=>0,'msg'=>'请先删除该栏目下的 '.$count.' 条数据')); } } $result = $this->model->destroy($id); if($result){ if($category['model_id'] == 1){model('common/page')->destroy(['category_id' => $id]);} $this->model->cache_category(); return json(array('code'=>200,'msg'=>'删除成功')); }else{ return json(array('code'=>0,'msg'=>'删除失败')); } }