From db9e4b00e75cbd04752e9e084a999daf0c3ab134 Mon Sep 17 00:00:00 2001 From: molong Date: Fri, 26 Aug 2016 08:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8Fbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Group.php | 6 +++--- application/common/model/AuthRule.php | 17 +---------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/application/admin/controller/Group.php b/application/admin/controller/Group.php index 92859c3e..c6bb676e 100644 --- a/application/admin/controller/Group.php +++ b/application/admin/controller/Group.php @@ -211,7 +211,7 @@ class Group extends Admin { if (IS_POST) { $result = $this->rule->change(); if ($result) { - return $this->success("创建成功!"); + return $this->success("创建成功!", url('admin/group/access')); }else{ return $this->error($this->rule->getError()); } @@ -229,8 +229,8 @@ class Group extends Admin { public function editnode($id){ if (IS_POST) { $result = $this->rule->change(); - if ($result) { - return $this->success("更新成功!"); + if (false !== $result) { + return $this->success("更新成功!", url('admin/group/access')); }else{ return $this->error("更新失败!"); } diff --git a/application/common/model/AuthRule.php b/application/common/model/AuthRule.php index e34dcf17..d00e5b8c 100644 --- a/application/common/model/AuthRule.php +++ b/application/common/model/AuthRule.php @@ -22,7 +22,7 @@ class AuthRule extends Base{ ); public $keyList = array( - array('name'=>'id','title'=>'标识','type'=>'hidden'), + //array('name'=>'id','title'=>'标识','type'=>'hidden'), array('name'=>'module','title'=>'所属模块','type'=>'hidden'), array('name'=>'title','title'=>'节点名称','type'=>'text','help'=>''), array('name'=>'name','title'=>'节点标识','type'=>'text','help'=>''), @@ -30,19 +30,4 @@ class AuthRule extends Base{ array('name'=>'status','title'=>'状态','type'=>'select','option'=>array('1'=>'启用','0'=>'禁用'),'help'=>''), array('name'=>'condition','title'=>'条件','type'=>'text','help'=>'') ); - - public function change(){ - $data = input('post.'); - if ($data['id']) { - $result = $this->save($data, array('id'=>$data)); - }else{ - $result = $this->save($data); - } - if (false !== $result) { - return true; - }else{ - $this->error = "失败!"; - return false; - } - } } \ No newline at end of file