diff --git a/application/admin/controller/AuthRule.php b/application/admin/controller/AuthRule.php
index abb1b154..a8380747 100644
--- a/application/admin/controller/AuthRule.php
+++ b/application/admin/controller/AuthRule.php
@@ -161,7 +161,7 @@ class AuthRule extends Base
$validate = new \app\admin\validate\Rule;
// 获取表单数据
- $list = request()->only(['title','name','pid','condition','paixu','ismenu','font','beizhu'],'post');
+ $list = request()->only(['title','name','pid','condition','paixu','ismenu','font','beizhu'],'put');
// 验证表单数据
$result = $validate->check($list);
diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php
index 6b078d34..7c488e5d 100644
--- a/application/admin/controller/Index.php
+++ b/application/admin/controller/Index.php
@@ -193,11 +193,12 @@ class Index extends Base
$validate = new \app\admin\validate\Admin;
// 获取表单数据
- $list = request()->only(['xingming','username','sex','shengri','phone','beizhu'],'put');
+ $list = request()->only(['xingming','username','sex','shengri','phone','beizhu','group_id'],'put');
// 验证表单数据
$result = $validate->check($list);
$msg = $validate->getError();
+ unset($list['group_id']);
// 如果验证不通过则停止保存
if(!$result){
@@ -205,7 +206,8 @@ class Index extends Base
}
// 更新管理员信息
- $data = AD::where('id',$id)->update($list);
+ $admin = new AD();
+ $data = $admin->save($list,['id'=>$id]);
// 更新管理员角色
$group_id = request()->put('group_id');
diff --git a/application/admin/model/Admin.php b/application/admin/model/Admin.php
index b63bafb2..4119b814 100644
--- a/application/admin/model/Admin.php
+++ b/application/admin/model/Admin.php
@@ -20,7 +20,7 @@ class Admin extends Base
}
// 生日修改器
- public function setShenriAttr($value)
+ public function setShengriAttr($value)
{
return strtotime($value);
}
diff --git a/application/admin/view/index/edit.html b/application/admin/view/index/edit.html
index ccdebb9c..3e081dae 100644
--- a/application/admin/view/index/edit.html
+++ b/application/admin/view/index/edit.html
@@ -19,7 +19,7 @@
{php}
$group = db('auth_group')->where('status',true)->field('id,title')->all();
{/php}
- {volist name="group" id="vo" key="k"}{$list['group_id']}{$vo.id}
+ {volist name="group" id="vo" key="k"}
diff --git a/application/common.php b/application/common.php
index 62eb271a..266a749d 100644
--- a/application/common.php
+++ b/application/common.php
@@ -11,3 +11,28 @@
// 应用公共文件
+// 获取类别列表
+function getCategory($id = 0)
+{
+ // 根据父级id查询类别列表
+ $list = db('category')
+ ->where('pid',$id)
+ ->where('status',1)
+ ->field('id,title')
+ ->select();
+
+ // 返回类别列表
+ return $list;
+}
+
+
+// 获取类别名称
+function getCategoryTitle($id)
+{
+ // 根据id查询类别名
+ $value = db('category')
+ ->where('id',$id)
+ ->vlaue('title');
+ // 返回类别名
+ return $value;
+}
\ No newline at end of file
diff --git a/application/system/model/Category.php b/application/system/model/Category.php
index 2ea00666..462e8a2b 100644
--- a/application/system/model/Category.php
+++ b/application/system/model/Category.php
@@ -6,16 +6,6 @@ use app\common\model\Base;
class Category extends Base
{
- // 获取类别列表
- public function getCategory($id = 0)
- {
- return $this
- ->where('pid',$id)
- ->where('status',1)
- ->field('id,title')
- ->select();
- }
-
// 父级类别获取器
public function getPidAttr($value)
diff --git a/application/system/model/School.php b/application/system/model/School.php
index 152b73fd..968bb403 100644
--- a/application/system/model/School.php
+++ b/application/system/model/School.php
@@ -24,12 +24,13 @@ class School extends Base
return $this->getcategory($value);
}
-
- // category查询
+ // 获取类别名
public function getcategory($id)
{
- return db('category')
- ->where('id',$id)
- ->value('title');
+ return db('category')
+ ->where('id',$id)
+ ->value('title');
}
+
+
}
diff --git a/application/system/view/category/create.html b/application/system/view/category/create.html
index e3d2492c..51ad17d0 100644
--- a/application/system/view/category/create.html
+++ b/application/system/view/category/create.html
@@ -17,10 +17,6 @@
{volist name="pid" id="vo"}
- {php} $child = $cgmod->getCategory($vo['id']);{/php}
- {volist name="child" id="va"}
-
- {/volist}
{/volist}
diff --git a/application/system/view/category/edit.html b/application/system/view/category/edit.html
index c4419132..caeb4f74 100644
--- a/application/system/view/category/edit.html
+++ b/application/system/view/category/edit.html
@@ -17,10 +17,6 @@
{volist name="pid" id="vo"}
- {php} $child = $authrulemod->getCategory($vo['id']);{/php}
- {volist name="child" id="va"}
-
- {/volist}
{/volist}
diff --git a/application/system/view/school/create.html b/application/system/view/school/create.html
index f4a4efca..f7d4fd07 100644
--- a/application/system/view/school/create.html
+++ b/application/system/view/school/create.html
@@ -15,7 +15,7 @@
-
+
@@ -24,7 +24,7 @@