目录结构调整
This commit is contained in:
@@ -244,14 +244,9 @@ class Addons extends Admin {
|
||||
public function addhook(){
|
||||
$hooks = model('Hooks');
|
||||
if (IS_POST) {
|
||||
$data = input();
|
||||
if ($data) {
|
||||
$result = $hooks->change($data);
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
$result = $hooks->change();
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
@@ -270,14 +265,9 @@ class Addons extends Admin {
|
||||
public function edithook($id){
|
||||
$hooks = model('Hooks');
|
||||
if (IS_POST) {
|
||||
$data = input('post.');
|
||||
if ($data) {
|
||||
$result = $hooks->change($data);
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
$result = $hooks->change();
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
|
||||
@@ -50,8 +50,9 @@ class Content extends Admin{
|
||||
$map = $this->buildMap();
|
||||
$field = array_filter($grid_list['fields']);
|
||||
if ($this->modelInfo['extend'] == 1) {
|
||||
$map['model_id'] = $this->modelInfo['id'];
|
||||
array_push($field, 'is_top');
|
||||
}else{
|
||||
unset($map['model_id']);
|
||||
}
|
||||
|
||||
$list = $this->model->where($map)->field($field)->order($order)->paginate(15);
|
||||
@@ -249,21 +250,27 @@ class Content extends Admin{
|
||||
*/
|
||||
protected function buildMap(){
|
||||
$map = array();
|
||||
$keyword = input('get.keyword', '', 'trim');
|
||||
$category = input('get.category', '', 'trim');
|
||||
|
||||
if ($keyword) {
|
||||
$map['title'] = array("LIKE", "%$keyword%");
|
||||
}
|
||||
if ($category){
|
||||
$map['category_id'] = $category;
|
||||
$data = $this->request->get();
|
||||
foreach ($data as $key => $value) {
|
||||
if ($value) {
|
||||
if ($key == 'keyword') {
|
||||
$map['title'] = array("LIKE", "%$value%");
|
||||
}elseif($key == 'category'){
|
||||
$map['category_id'] = $value;
|
||||
}elseif($key == 'create_time'){
|
||||
$map['create_time'] = array('BETWEEN',array(strtotime($value[0]),strtotime($value[1])));
|
||||
}else{
|
||||
$map[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->modelInfo['extend'] == 1) {
|
||||
$category = isset($data['category']) ? $data['category'] : '';
|
||||
$cate_list = parse_field_bind('category', $category, $this->modelInfo['id']);
|
||||
$this->assign('cate_list', $cate_list);
|
||||
}
|
||||
$this->assign($this->request->get());
|
||||
$this->assign($data);
|
||||
return $map;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,7 @@ class Group extends Admin {
|
||||
|
||||
|
||||
//会员分组首页控制器
|
||||
public function index(){
|
||||
$type = input('get.type','admin','trim');
|
||||
|
||||
public function index($type = 'admin'){
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthGroup')->where($map)->order('id desc')->paginate(10);
|
||||
@@ -112,9 +110,7 @@ class Group extends Admin {
|
||||
}
|
||||
|
||||
//权限节点控制器
|
||||
public function access(){
|
||||
$type = input('get.type','admin','trim');
|
||||
|
||||
public function access($type = 'admin'){
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(10);
|
||||
@@ -253,8 +249,7 @@ class Group extends Admin {
|
||||
}
|
||||
}
|
||||
|
||||
public function delnode(){
|
||||
$id = input('id','','trim,intval');
|
||||
public function delnode($id){
|
||||
if (!$id) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
|
||||
@@ -118,11 +118,8 @@ class User extends Admin{
|
||||
* del
|
||||
* @author colin <colin@tensent.cn>
|
||||
*/
|
||||
public function del(){
|
||||
$ids = input('post.ids');
|
||||
//多条删除和单条删除
|
||||
empty($ids) ? $ids = input('get.id') : $ids = $ids;
|
||||
$uid = array('IN',is_array($ids) ? implode(',',$ids) : $ids);
|
||||
public function del($id){
|
||||
$uid = array('IN',is_array($id) ? implode(',',$id) : $id);
|
||||
//获取用户信息
|
||||
$find = $this->getUserinfo($uid);
|
||||
model('User')->where(array('uid'=>$uid))->delete();
|
||||
|
||||
Reference in New Issue
Block a user